public async void ThrowExceptionDueToInvalidApiKey() { const string invalidApiKey = "This shouldn't work"; var w3w = new What3Words(invalidApiKey); Should.Throw <UnauthorizedAccessException>(async() => await w3w.ConvertTo3wa(42.998737, -81.254357)) .Message.ShouldBe("The API key is invalid"); }
public async void ReturnCorrectReverseGeocodeResponse() { var w3w = new What3Words(ApiKey); var result = await w3w.ConvertTo3wa(42.998747, -81.254366); result.ToString().ShouldBe("offshore.bitters.voltage"); result.Map.ShouldBe("https://w3w.co/offshore.bitters.voltage"); result.NearestPlace.ShouldBe("London, Ontario"); result.Country.ShouldBe("CA"); result.Coordinates.Lat.ShouldBe(42.998747); result.Coordinates.Lng.ShouldBe(-81.254366); }