In my Locationer
class I have function GetLocationAsync()
which uses Xamarin.Essentials: Geolocation. This function works fine but I would like to create unit test for this function.
I created xUnitTests project and unit test:
public async Task LocationTest()
{
Locationer locationer = new Locationer();
var actual = locationer.GetLocationAsync();
Assert.Equal("test", actual);
}
In Xamarin Forms project GetLocationAsync()
returns "Latitude: 46.55465, Longitude: 15.64588, Altitude: 262".
In my unit tests GetLocationAsync()
returns "This functionality is not implemented in the portable version of this assembly"
Is it possible to use Xamarin.Essentials: Geolocation in my Unit Tests project? How can I fix it?