Mono Android. Unit test framework

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.

+4
source share
3 answers

If you are looking for running Visual Studio Unit tests in Mono for Android, I wrote a compatible layer for them along with a graphical interface.

Check here

Tests OverviewTests Details

+3
source

If you want to run unit tests on devices (or inside an emulator), you should take a look at Andr.Unit Mono for Android test runner for NUnitLite (0.6). It is similar (a similar version of UI and NUnitLite) to Touch.Unit (iOS), even if it (currently) is slightly behind in functions (there is no network registration).

Disclaimer: I wrote a runner

+1
source

If you want to reference assemblies from a Mono application for Android or MonoTouch or Silverlight, you must use assemblies that were also compiled against the same profile.

This is profile 2.0.5.0.

0
source

All Articles