3

Is there any way to get the built-in MS Test framework to work with Mono for Android? I know they are compiled against different .NET framework profiles which is part of the problem - Mono Android. Unit test framework - but does anyone have a work around for this?

An NUnit or other open source test framework solution would be acceptable as well - but I've read the same issues exist with NUnit. Perhaps there could be an NUnit framework compiled against the same profile as Mono?

I have searched around and the resources are limited.

Community
  • 1
  • 1
Chris Hawkins
  • 808
  • 1
  • 7
  • 22

3 Answers3

2

i don't think that you can; however, i would recommend that you migrate your non-android specific code into a secondary .net assembly (one targeting .net 3.5 or 4.0 or whatever) that testing that assembly. then add linked files into your mono for android project to get your tested code into your project. if you code it in regular .net then you can use what ever testing framework you want to.

jcwmoore
  • 1,153
  • 8
  • 13
  • So then it sounds like it's a good idea to keep as little logic as possible in the android portion of the app... thanks! – Chris Hawkins Aug 15 '11 at 12:31
1

I ended up using MonoDroid-UnitTest. I find it's the only Xamarin Android unit test framework I've seen that's being actively maintained

Earlz
  • 62,085
  • 98
  • 303
  • 499
1

As an alternative you might want to look at Andr.Unit which allows you to run your unit tests on devices (or emulator). It's a runner based NUnitLite 0.6 which makes it easy to share code with Touch.Unit (if you also develop for iOS devices).

Disclaimer: I wrote the runner

Community
  • 1
  • 1
poupou
  • 43,413
  • 6
  • 77
  • 174