From 080bd3c2224ebe9bc89cd33ecc6fa3407df2870f Mon Sep 17 00:00:00 2001 From: Max Novak Date: Wed, 9 Oct 2024 16:26:10 +0300 Subject: [PATCH] Fix tests warnings --- .../IntegrationTests/BaseTestIntegration.cs | 5 +++-- .../IntegrationTests/DirectionsTests.cs | 12 ++++++------ .../IntegrationTests/DistanceMatrixTests.cs | 16 ++++++++-------- .../IntegrationTests/ElevationTests.cs | 4 ++-- .../IntegrationTests/GeocodingTests.cs | 16 ++++++++-------- .../IntegrationTests/PlaceAutocompleteTests.cs | 14 +++++++------- .../IntegrationTests/PlacesDetailsTests.cs | 9 +++++---- .../IntegrationTests/PlacesNearByTests.cs | 8 +++++--- .../IntegrationTests/PlacesSearchTests.cs | 8 +++++--- GoogleMapsApi.Test/LocationToStringTest.cs | 4 ++-- 10 files changed, 51 insertions(+), 45 deletions(-) diff --git a/GoogleMapsApi.Test/IntegrationTests/BaseTestIntegration.cs b/GoogleMapsApi.Test/IntegrationTests/BaseTestIntegration.cs index bcbc0d6..208e8c7 100644 --- a/GoogleMapsApi.Test/IntegrationTests/BaseTestIntegration.cs +++ b/GoogleMapsApi.Test/IntegrationTests/BaseTestIntegration.cs @@ -2,7 +2,7 @@ using System.IO; namespace GoogleMapsApi.Test.IntegrationTests -{ +{ // Note: The integration tests run against the real Google API web // servers and count towards your query limit. Also, the tests // require a working internet connection in order to pass. @@ -11,6 +11,7 @@ namespace GoogleMapsApi.Test.IntegrationTests public class BaseTestIntegration { + const string ApiKeyEnvironmentVariable = "GOOGLE_API_KEY"; private readonly IConfigurationRoot Configuration; public BaseTestIntegration() @@ -22,6 +23,6 @@ public BaseTestIntegration() .Build(); } - protected string ApiKey => Configuration.GetValue("GOOGLE_API_KEY"); + protected string ApiKey => Configuration.GetValue(ApiKeyEnvironmentVariable) ?? throw new InvalidOperationException($"API key is not configured. Please set the {ApiKeyEnvironmentVariable} environment variable."); } } diff --git a/GoogleMapsApi.Test/IntegrationTests/DirectionsTests.cs b/GoogleMapsApi.Test/IntegrationTests/DirectionsTests.cs index c78224c..ef1fb59 100644 --- a/GoogleMapsApi.Test/IntegrationTests/DirectionsTests.cs +++ b/GoogleMapsApi.Test/IntegrationTests/DirectionsTests.cs @@ -48,8 +48,8 @@ public async Task Directions_WithWayPoints() var result = await GoogleMaps.Directions.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(DirectionsStatusCodes.OK, Is.EqualTo(result.Status), result.ErrorMessage); - Assert.That(156097, Is.EqualTo(result.Routes.First().Legs.First().Steps.Sum(s => s.Distance.Value)).Within(10 * 1000)); + Assert.That(result.Status, Is.EqualTo(DirectionsStatusCodes.OK), result.ErrorMessage); + Assert.That(result.Routes.First().Legs.First().Steps.Sum(s => s.Distance.Value), Is.EqualTo(156097).Within(10 * 1000)); Assert.That(result.Routes.First().Legs.First().EndAddress, Does.Contain("Philadelphia")); } @@ -79,7 +79,7 @@ public async Task Directions_ExceedingRouteLength() var result = await GoogleMaps.Directions.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(DirectionsStatusCodes.MAX_ROUTE_LENGTH_EXCEEDED, Is.EqualTo(result.Status), result.ErrorMessage); + Assert.That(result.Status, Is.EqualTo(DirectionsStatusCodes.MAX_ROUTE_LENGTH_EXCEEDED), result.ErrorMessage); } [Test] @@ -99,8 +99,8 @@ public async Task Directions_Correct_OverviewPath() OverviewPolyline overviewPath = result.Routes.First().OverviewPath; OverviewPolyline polyline = result.Routes.First().Legs.First().Steps.First().PolyLine; - Assert.That(DirectionsStatusCodes.OK, Is.EqualTo(result.Status), result.ErrorMessage); - Assert.That(122, Is.EqualTo(overviewPath.Points.Count()).Within(30)); + Assert.That(result.Status, Is.EqualTo(DirectionsStatusCodes.OK), result.ErrorMessage); + Assert.That(overviewPath.Points.Count(), Is.EqualTo(122).Within(30)); Assert.That(polyline.Points.Count(), Is.GreaterThan(1)); } @@ -112,7 +112,7 @@ public void DirectionsAsync_SumOfStepDistancesCorrect() var result = GoogleMaps.Directions.QueryAsync(request).Result; AssertInconclusive.NotExceedQuota(result); - Assert.That(DirectionsStatusCodes.OK, Is.EqualTo(result.Status), result.ErrorMessage); + Assert.That(result.Status, Is.EqualTo(DirectionsStatusCodes.OK)); Assert.That(result.Routes.First().Legs.First().Steps.Sum(s => s.Distance.Value), Is.GreaterThan(100)); } diff --git a/GoogleMapsApi.Test/IntegrationTests/DistanceMatrixTests.cs b/GoogleMapsApi.Test/IntegrationTests/DistanceMatrixTests.cs index 7ed3a76..2d5eb67 100644 --- a/GoogleMapsApi.Test/IntegrationTests/DistanceMatrixTests.cs +++ b/GoogleMapsApi.Test/IntegrationTests/DistanceMatrixTests.cs @@ -48,12 +48,12 @@ public async Task ShouldReturnValidValueWhenTwoOriginsSpecified() var result = await GoogleMaps.DistanceMatrix.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(DistanceMatrixStatusCodes.OK, Is.EqualTo(result.Status), result.ErrorMessage); + Assert.That(result.Status, Is.EqualTo(DistanceMatrixStatusCodes.OK)); Assert.That(result.DestinationAddresses, Is.EqualTo(new[] { "Alter Sirksfelder Weg 10, 23881 Koberg, Germany" })); Assert.That(result.OriginAddresses, Is.EqualTo(new[] { "St2154 18, 92726 Waidhaus, Germany", "Böhmerwaldstraße 19, 93444 Bad Kötzting, Germany" })); - Assert.That(2, Is.EqualTo(result.Rows.Count())); - Assert.That(DistanceMatrixElementStatusCodes.OK, Is.EqualTo(result.Rows.First().Elements.First().Status)); - Assert.That(DistanceMatrixElementStatusCodes.OK, Is.EqualTo(result.Rows.Last().Elements.First().Status)); + Assert.That(result.Rows.Count(), Is.EqualTo(2)); + Assert.That(result.Rows.First().Elements.First().Status, Is.EqualTo(DistanceMatrixElementStatusCodes.OK)); + Assert.That(result.Rows.Last().Elements.First().Status, Is.EqualTo(DistanceMatrixElementStatusCodes.OK)); } [Test] @@ -70,7 +70,7 @@ public async Task ShouldReturnDurationInTrafficWhenDepartureTimeAndApiKeySpecifi var result = await GoogleMaps.DistanceMatrix.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(DistanceMatrixStatusCodes.OK, Is.EqualTo(result.Status), result.ErrorMessage); + Assert.That(result.Status, Is.EqualTo(DistanceMatrixStatusCodes.OK)); Assert.That(result.Rows.First().Elements.First().DurationInTraffic, Is.Not.Null); } @@ -207,8 +207,8 @@ static Uri onUriCreated(Uri uri) var result = await GoogleMaps.DistanceMatrix.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(DistanceMatrixStatusCodes.OK, Is.EqualTo(result.Status), result.ErrorMessage); - Assert.That("1,2", Is.EqualTo(result.OriginAddresses.First())); + Assert.That(result.Status, Is.EqualTo(DistanceMatrixStatusCodes.OK), result.ErrorMessage); + Assert.That(result.OriginAddresses.First(), Is.EqualTo("1,2")); } finally { @@ -237,7 +237,7 @@ public async Task ShouldPassRawDataToOnRawResponseRecivied() var result = await GoogleMaps.DistanceMatrix.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(DistanceMatrixStatusCodes.OK, Is.EqualTo(result.Status), result.ErrorMessage); + Assert.That(result.Status, Is.EqualTo(DistanceMatrixStatusCodes.OK), result.ErrorMessage); Assert.That(rawData, Is.Not.Empty); } finally diff --git a/GoogleMapsApi.Test/IntegrationTests/ElevationTests.cs b/GoogleMapsApi.Test/IntegrationTests/ElevationTests.cs index 3482eb2..6b5e6ee 100644 --- a/GoogleMapsApi.Test/IntegrationTests/ElevationTests.cs +++ b/GoogleMapsApi.Test/IntegrationTests/ElevationTests.cs @@ -38,8 +38,8 @@ public void ElevationAsync_ReturnsCorrectElevation() var result = GoogleMaps.Elevation.QueryAsync(request).Result; AssertInconclusive.NotExceedQuota(result); - Assert.That(Entities.Elevation.Response.Status.OK, Is.EqualTo(result.Status)); - Assert.That(16.92, Is.EqualTo(result.Results.First().Elevation).Within(1.0)); + Assert.That(result.Status, Is.EqualTo(Entities.Elevation.Response.Status.OK)); + Assert.That(result.Results.First().Elevation, Is.EqualTo(16.92).Within(1.0)); } } } diff --git a/GoogleMapsApi.Test/IntegrationTests/GeocodingTests.cs b/GoogleMapsApi.Test/IntegrationTests/GeocodingTests.cs index 61e8982..c604fec 100644 --- a/GoogleMapsApi.Test/IntegrationTests/GeocodingTests.cs +++ b/GoogleMapsApi.Test/IntegrationTests/GeocodingTests.cs @@ -42,7 +42,7 @@ public void GeocodingAsync_ReturnsCorrectLocation() var result = GoogleMaps.Geocode.QueryAsync(request).Result; AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); // 40.{*}, -73.{*} Assert.That(result.Results.First().Geometry.Location.LocationString, Does.Match("40\\.\\d*,-73\\.\\d*")); } @@ -102,7 +102,7 @@ public async Task ReverseGeocoding_LatLng_ReturnsCorrectAddress() var result = await GoogleMaps.Geocode.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.First().FormattedAddress, Does.Contain("Bedford Ave, Brooklyn, NY 11211, USA")); } @@ -118,7 +118,7 @@ public async Task ReverseGeocoding_PlaceId_ReturnsCorrectAddress() var result = await GoogleMaps.Geocode.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.First().FormattedAddress, Does.Contain("Bedford Ave, Brooklyn, NY 11211, USA")); } @@ -135,7 +135,7 @@ public async Task ReverseGeocoding_PlaceIdAndRegion_ReturnsCorrectAddress() var result = await GoogleMaps.Geocode.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.First().FormattedAddress, Does.Contain("Bedford Ave, Brooklyn, NY 11211, USA")); } @@ -156,7 +156,7 @@ public async Task ReverseGeocoding_PlaceIdAndBounds_ReturnsCorrectAddress() var result = await GoogleMaps.Geocode.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.First().FormattedAddress, Does.Contain("Bedford Ave, Brooklyn, NY 11211, USA")); } @@ -173,7 +173,7 @@ public async Task ReverseGeocoding_PlaceIdAndComponents_ReturnsCorrectAddress() var result = await GoogleMaps.Geocode.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.First().FormattedAddress, Does.Contain("Bedford Ave, Brooklyn, NY 11211, USA")); } @@ -190,7 +190,7 @@ public async Task ReverseGeocoding_PlaceIdAndAddress_ReturnsCorrectAddress() var result = await GoogleMaps.Geocode.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.First().FormattedAddress, Does.Contain("Bedford Ave, Brooklyn, NY 11211, USA")); } @@ -206,7 +206,7 @@ public void ReverseGeocodingAsync_ReturnsCorrectAddress() var result = GoogleMaps.Geocode.QueryAsync(request).Result; AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.First().FormattedAddress, Does.Contain("Bedford Ave, Brooklyn, NY 11211, USA")); } } diff --git a/GoogleMapsApi.Test/IntegrationTests/PlaceAutocompleteTests.cs b/GoogleMapsApi.Test/IntegrationTests/PlaceAutocompleteTests.cs index ed7d572..0986a7a 100644 --- a/GoogleMapsApi.Test/IntegrationTests/PlaceAutocompleteTests.cs +++ b/GoogleMapsApi.Test/IntegrationTests/PlaceAutocompleteTests.cs @@ -42,7 +42,7 @@ public async Task OffsetTest() PlaceAutocompleteResponse result = await GoogleMaps.PlaceAutocomplete.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.ZERO_RESULTS, Is.EqualTo(result.Status), "results for jibberish"); + Assert.That(result.Status, Is.EqualTo(Status.ZERO_RESULTS), "results for jibberish"); var offsetRequest = new PlaceAutocompleteRequest { @@ -55,7 +55,7 @@ public async Task OffsetTest() PlaceAutocompleteResponse offsetResult = await GoogleMaps.PlaceAutocomplete.QueryAsync(offsetRequest); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(offsetResult.Status), "results using offset"); + Assert.That(offsetResult.Status, Is.EqualTo(Status.OK), "results using offset"); } [Test] @@ -73,7 +73,7 @@ public async Task TypeTest() PlaceAutocompleteResponse result = await GoogleMaps.PlaceAutocomplete.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); foreach (var oneResult in result.Results) { @@ -98,7 +98,7 @@ public async Task CheckForExpectedRoad( string aSearch, string anExpected) PlaceAutocompleteResponse result = await GoogleMaps.PlaceAutocomplete.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.ZERO_RESULTS, Is.Not.EqualTo(result.Status)); + Assert.That(result.Status, Is.Not.EqualTo(Status.ZERO_RESULTS)); Assert.That(result.Results.Any(t => t.Description.ToUpper().Contains(anExpected))); } @@ -109,7 +109,7 @@ public async Task CheckZeroRadius() var request = CreatePlaceAutocompleteRequest("RIX", 0); PlaceAutocompleteResponse result = await GoogleMaps.PlaceAutocomplete.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.ZERO_RESULTS, Is.Not.EqualTo(result.Status)); + Assert.That(result.Status, Is.Not.EqualTo(Status.ZERO_RESULTS)); } [Test(Description = "Ensures that it is ok to sent negative value as a radius")] public async Task CheckNegativeRadius() @@ -117,7 +117,7 @@ public async Task CheckNegativeRadius() var request = CreatePlaceAutocompleteRequest("RIX", -1); PlaceAutocompleteResponse result = await GoogleMaps.PlaceAutocomplete.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.ZERO_RESULTS, Is.Not.EqualTo(result.Status)); + Assert.That(result.Status, Is.Not.EqualTo(Status.ZERO_RESULTS)); } [Test(Description = "Ensures that it is ok to sent huge value as a radius")] @@ -126,7 +126,7 @@ public async Task CheckLargerThenEarthRadius() var request = CreatePlaceAutocompleteRequest("RIX", 30000000); PlaceAutocompleteResponse result = await GoogleMaps.PlaceAutocomplete.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.ZERO_RESULTS, Is.Not.EqualTo(result.Status)); + Assert.That(result.Status, Is.Not.EqualTo(Status.ZERO_RESULTS)); } private PlaceAutocompleteRequest CreatePlaceAutocompleteRequest(string query, double? radius) diff --git a/GoogleMapsApi.Test/IntegrationTests/PlacesDetailsTests.cs b/GoogleMapsApi.Test/IntegrationTests/PlacesDetailsTests.cs index 995e0d9..67f380c 100644 --- a/GoogleMapsApi.Test/IntegrationTests/PlacesDetailsTests.cs +++ b/GoogleMapsApi.Test/IntegrationTests/PlacesDetailsTests.cs @@ -40,7 +40,7 @@ public async Task ReturnsNotFoundForWrongReferenceString() PlacesDetailsResponse result = await GoogleMaps.PlacesDetails.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.NOT_FOUND, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.NOT_FOUND)); } readonly PriceLevel[] anyPriceLevel = new PriceLevel[] { PriceLevel.Free, PriceLevel.Inexpensive, PriceLevel.Moderate, PriceLevel.Expensive, PriceLevel.VeryExpensive }; @@ -57,7 +57,8 @@ public async Task ReturnsStronglyTypedPriceLevel() PlacesDetailsResponse result = await GoogleMaps.PlacesDetails.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); + Assert.That(result.Result.PriceLevel, Is.Not.Null); Assert.That(new PriceLevel[] { result.Result.PriceLevel.Value }, Is.SubsetOf(anyPriceLevel)); } @@ -73,7 +74,7 @@ public async Task ReturnsOpeningTimes() PlacesDetailsResponse result = await GoogleMaps.PlacesDetails.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); // commented out because seems like google doesn't have opening hours for this place anymore /* @@ -87,7 +88,7 @@ public async Task ReturnsOpeningTimes() */ } - private string cachedMyPlaceId; + private string? cachedMyPlaceId; private async Task GetMyPlaceId() { if (cachedMyPlaceId == null) diff --git a/GoogleMapsApi.Test/IntegrationTests/PlacesNearByTests.cs b/GoogleMapsApi.Test/IntegrationTests/PlacesNearByTests.cs index a8f778d..1345549 100644 --- a/GoogleMapsApi.Test/IntegrationTests/PlacesNearByTests.cs +++ b/GoogleMapsApi.Test/IntegrationTests/PlacesNearByTests.cs @@ -46,7 +46,7 @@ public async Task TestNearbySearchType() PlacesNearByResponse result = await GoogleMaps.PlacesNearBy.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.Any(), Is.True); Assert.That(result.Results.Any(t => t.Name.Contains("John F. Kennedy")), Is.True); } @@ -65,7 +65,7 @@ public async Task TestNearbySearchPagination() PlacesNearByResponse result = await GoogleMaps.PlacesNearBy.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); //we should have more than one page of pizza results from the NearBy Search Assert.That(!String.IsNullOrEmpty(result.NextPage), Is.True); //a full page of results is always 20 @@ -85,10 +85,12 @@ public async Task TestNearbySearchPagination() PageToken = result.NextPage }; result = await GoogleMaps.PlacesNearBy.QueryAsync(request); - Assert.That(GoogleMapsApi.Entities.PlacesNearBy.Response.Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); //make sure the second page has some results Assert.That(result.Results != null && result.Results.Any(), Is.True); //make sure the result from the first page isn't on the second page to confirm we actually got a second page with new results + Assert.That(result.Results, Is.Not.Null); + Assert.That(resultFromFirstPage, Is.Not.Null); Assert.That(result.Results.Any(t => t.PlaceId == resultFromFirstPage.PlaceId), Is.False); } } diff --git a/GoogleMapsApi.Test/IntegrationTests/PlacesSearchTests.cs b/GoogleMapsApi.Test/IntegrationTests/PlacesSearchTests.cs index 51d123e..20841fa 100644 --- a/GoogleMapsApi.Test/IntegrationTests/PlacesSearchTests.cs +++ b/GoogleMapsApi.Test/IntegrationTests/PlacesSearchTests.cs @@ -46,7 +46,7 @@ public async Task TestNearbySearchType() PlacesResponse result = await GoogleMaps.Places.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); Assert.That(result.Results.Any(), Is.True); Assert.That(result.Results.Any(t => t.Name.Contains("John F. Kennedy")), Is.True); } @@ -65,7 +65,7 @@ public async Task TestNearbySearchPagination() PlacesResponse result = await GoogleMaps.Places.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); //we should have more than one page of pizza results from the NearBy Search Assert.That(!String.IsNullOrEmpty(result.NextPage), Is.True); //a full page of results is always 20 @@ -87,10 +87,12 @@ public async Task TestNearbySearchPagination() result = await GoogleMaps.Places.QueryAsync(request); AssertInconclusive.NotExceedQuota(result); - Assert.That(Status.OK, Is.EqualTo(result.Status)); + Assert.That(result.Status, Is.EqualTo(Status.OK)); //make sure the second page has some results Assert.That(result.Results != null && result.Results.Any(), Is.True); //make sure the result from the first page isn't on the second page to confirm we actually got a second page with new results + Assert.That(result.Results, Is.Not.Null); + Assert.That(resultFromFirstPage, Is.Not.Null); Assert.That(result.Results.Any(t => t.PlaceId == resultFromFirstPage.PlaceId), Is.False); } } diff --git a/GoogleMapsApi.Test/LocationToStringTest.cs b/GoogleMapsApi.Test/LocationToStringTest.cs index 0ed0cc8..8036083 100644 --- a/GoogleMapsApi.Test/LocationToStringTest.cs +++ b/GoogleMapsApi.Test/LocationToStringTest.cs @@ -11,7 +11,7 @@ public void WhenNearZeroLongitude_ExpectCorrectToString() { // Longitude of 0.000009 is converted to 9E-06 using Invariant ToString, but we need 0.000009 var location = new Location(57.231d, 0.000009d); - Assert.That("57.231,0.000009", Is.EqualTo(location.ToString())); + Assert.That(location.ToString(), Is.EqualTo("57.231,0.000009")); } [Test] @@ -19,7 +19,7 @@ public void WhenZeroLongitude_ExpectCorrectToString() { // Longitude of 0.000009 is converted to 9E-06 using Invariant ToString, but we need 0.000009 var location = new Location(52.123123d, 0.0d); - Assert.That("52.123123,0.0", Is.EqualTo(location.ToString())); + Assert.That(location.ToString(), Is.EqualTo("52.123123,0.0")); } } }