Hello,
I have built a Xamarin.Forms application and used the dependency service mechanism to access platform specific (iOS and Android) features.
At runtime, DependencyService.Get<>() returns the expected object and the app runs fine on both iOS and Android.
However, when trying to unit test (i.e. using the NUnit project for Android), the same DependencyService.Get<>() does not return the expected object anymore. The obvious thing to do was to reference both the .Droid application and the portable library. Also, tried to add the definitions for the dependency services to the unit test project as well. Same result.
Any insight on how to build unit tests for classes that use dependency services?
Thanks!