Unit test Xamarin Android project business logic

Viewed 33

I have a problem with Unit testing a Xamarin Android project.

My setup:

  • Shared Xamarin project
  • ClientX.Android
  • ClientX.iOS
  • Native.Android
  • Native.iOS

Native.Android contains no resources, no MainActivity and no Androidmanifest. It's just shared Mono.Android code and normal business logic for it.

I have an Xunit testing project with which I have been able to test the Shared Xamarin project.

I need to test some business logic that is contained inside Native.Android but I get an error (which does make sense to me):

Severity Code Description Project File Line Suppression State Error NU1201 Project Client.XXXX.NativeDroid is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Project Client.XXX.NativeDroid supports: monoandroid12.0 (MonoAndroid,Version=v12.0) XXX.UnitTests

I can't find how I should go about Unit tests inside a Xamarin Android project that is not view/UI related.

0 Answers
Related