Are there unit test frameworks that support mono android apps? I have already tested the standard Visual Studio test environment and the NUnit framework with no luck. My last attempt: I created the Mono Android class library, referring to nunit.framework, wrote tests. But when I tried to run them, I have an exception:
System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'mscorlib, Version=2.0.0.0'
Stack trace:
Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at NUnit.Core.TestRunner.Load(TestPackage package) at NUnit.Util.TestDomain.Load(TestPackage package) at NUnit.Util.TestLoader.LoadTest(String testName)
I am sure that this is due to the incompatibility of monoblock assemblies with other assemblies ...
So my question is: how to make it work? Or maybe there are some other unit tests for mono android applications?
UPD: Workaround for this problem.
Since I needed to test platform-independent models, I just created a separate Windows Class Library proxy project and added links to model classes from my Mono library for Android Class to it (Project => Add existing item ... => [ select all files to be added as links] => Add as link).
Therefore, I got compatibility with any unit test framework assembly, which consists of classes that need to be tested.
source share