From 0f33d67a4f4b5d3022bce9881a9394441ee9964a Mon Sep 17 00:00:00 2001 From: Eric Newton Date: Tue, 26 Dec 2017 11:49:07 -0500 Subject: [PATCH 1/3] reorg projects in sln --- src/GoogleMapsForNET.sln | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/GoogleMapsForNET.sln b/src/GoogleMapsForNET.sln index 2fef6d0..073bb57 100644 --- a/src/GoogleMapsForNET.sln +++ b/src/GoogleMapsForNET.sln @@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Maps.Test", "Google. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{81703210-2D39-4A33-8F6B-7E1689F65B9E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{9C1B8BBB-362C-4D4B-8D94-FBA657706AE6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,8 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {D98DFE5A-BB2C-4439-A0F6-B4E64987DDDE} = {B74E7466-5EBB-4FB1-9AF0-B0C57C139612} + {C2E1656D-A708-4240-8E67-EA97BAD208F4} = {9C1B8BBB-362C-4D4B-8D94-FBA657706AE6} + {81703210-2D39-4A33-8F6B-7E1689F65B9E} = {B74E7466-5EBB-4FB1-9AF0-B0C57C139612} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2C033920-B14E-4E99-BE83-45EC87FEA965} From da2831de97e15273e337e8cda09e096bb3d8c8f1 Mon Sep 17 00:00:00 2001 From: Eric Newton Date: Tue, 26 Dec 2017 12:10:04 -0500 Subject: [PATCH 2/3] reset tests that check for specific values to a category --- .../Direction/DirectionServiceTests.cs | 2 +- .../Elevation/ElevationServiceTests.cs | 10 ++++++++++ .../Geocoding/GeocodingRequestTests.cs | 2 ++ .../Geocoding/GeocodingServiceTests.cs | 7 +++++++ src/Google.Maps.Test/QuickExamplesTests.cs | 8 +++++++- src/Google.Maps.Test/TimeZone/TimeZoneServiceTests.cs | 2 ++ 6 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/Google.Maps.Test/Direction/DirectionServiceTests.cs b/src/Google.Maps.Test/Direction/DirectionServiceTests.cs index f9e0785..aa912cf 100644 --- a/src/Google.Maps.Test/Direction/DirectionServiceTests.cs +++ b/src/Google.Maps.Test/Direction/DirectionServiceTests.cs @@ -56,7 +56,7 @@ public void Empty_Address_Fails() } [Test] - [Ignore("currentLeg.Duration value keeps changing")] + [Category("ValueTesting")] public void GetResultForDirections_ex1() { // Arrange diff --git a/src/Google.Maps.Test/Elevation/ElevationServiceTests.cs b/src/Google.Maps.Test/Elevation/ElevationServiceTests.cs index 20fb602..37e514d 100644 --- a/src/Google.Maps.Test/Elevation/ElevationServiceTests.cs +++ b/src/Google.Maps.Test/Elevation/ElevationServiceTests.cs @@ -39,6 +39,15 @@ public void OneTimeSetUp() } [Test] + [Category("ValueTesting")] + public void SHOULD_NOT_RUN() + { + Console.WriteLine("SHOULD NOT RUN!!!"); + } + + + [Test] + [Category("ValueTesting")] public void GetElevationForOneLocation() { // expectations @@ -63,6 +72,7 @@ public void GetElevationForOneLocation() } [Test] + [Category("ValueTesting")] public void GetElevationForTwoLocations() { // expectations diff --git a/src/Google.Maps.Test/Geocoding/GeocodingRequestTests.cs b/src/Google.Maps.Test/Geocoding/GeocodingRequestTests.cs index b941714..a16fc44 100644 --- a/src/Google.Maps.Test/Geocoding/GeocodingRequestTests.cs +++ b/src/Google.Maps.Test/Geocoding/GeocodingRequestTests.cs @@ -51,6 +51,7 @@ public class GeocodingRequestTests //} [Test] + [Category("ValueTesting")] public void Implicit_Address_set_from_string() { var req = new GeocodingRequest(); @@ -63,6 +64,7 @@ public void Implicit_Address_set_from_string() } [Test] + [Category("ValueTesting")] public void LatLng_for_address_will_invoke_reverse_geocoding() { var req = new GeocodingRequest(); diff --git a/src/Google.Maps.Test/Geocoding/GeocodingServiceTests.cs b/src/Google.Maps.Test/Geocoding/GeocodingServiceTests.cs index bae3183..8dce18b 100644 --- a/src/Google.Maps.Test/Geocoding/GeocodingServiceTests.cs +++ b/src/Google.Maps.Test/Geocoding/GeocodingServiceTests.cs @@ -53,6 +53,7 @@ public void Empty_address() } [Test] + [Category("ValueTesting")] public void GetGeocodingForAddress1() { // Arrange @@ -81,6 +82,7 @@ public void GetGeocodingForAddress1() } [Test] + [Category("ValueTesting")] public void GetGeocodingForAddress2() { // test @@ -98,6 +100,7 @@ public void GetGeocodingForAddress2() } [Test] + [Category("ValueTesting")] public void Geocode_With_AddressComponent_Locking() { var requestGB = new GeocodingRequest @@ -130,6 +133,7 @@ public void Geocode_With_AddressComponent_Locking() } [Test] + [Category("ValueTesting")] public void Geocode_Without_AddressComponent_Locking() { var request = new GeocodingRequest @@ -146,6 +150,7 @@ public void Geocode_Without_AddressComponent_Locking() } [Test] + [Category("ValueTesting")] public void GeocodeResult_Has_BoundsProperty() { var request = new GeocodingRequest @@ -162,6 +167,7 @@ public void GeocodeResult_Has_BoundsProperty() } [Test] + [Category("ValueTesting")] public void GeocodeResult_Supports_PostalTownAndPostalCodePrefix() { var request = new GeocodingRequest @@ -179,6 +185,7 @@ public void GeocodeResult_Supports_PostalTownAndPostalCodePrefix() } [Test] + [Category("ValueTesting")] public void Utf8_Request_And_Response() { var request = new GeocodingRequest diff --git a/src/Google.Maps.Test/QuickExamplesTests.cs b/src/Google.Maps.Test/QuickExamplesTests.cs index 4acccbf..5e6e0c2 100644 --- a/src/Google.Maps.Test/QuickExamplesTests.cs +++ b/src/Google.Maps.Test/QuickExamplesTests.cs @@ -18,6 +18,7 @@ class QuickExamplesTests { [Test] + [Category("ValueTesting")] public void GeocodingRequest_Example() { var request = new GeocodingRequest(); @@ -32,6 +33,8 @@ public void GeocodingRequest_Example() Console.WriteLine("Latitude: " + result.Geometry.Location.Latitude); // 37.4230180 Console.WriteLine("Longitude: " + result.Geometry.Location.Longitude); // -122.0818530 + //dont assert on actual values sent from google, these can vary!!! + Assert.Pass(); } @@ -45,10 +48,13 @@ public void StaticMapRequest_Example() var imgTagSrc = map.ToUri(); - Assert.Pass(); + //check program functional outputs, not google's returned values + + Assert.That(imgTagSrc.Query.Contains("zoom=14")); } [Test] + [Category("ValueTesting")] public void PartialMatchTest() { // invalid address results in partial match diff --git a/src/Google.Maps.Test/TimeZone/TimeZoneServiceTests.cs b/src/Google.Maps.Test/TimeZone/TimeZoneServiceTests.cs index 5861b56..168ad41 100644 --- a/src/Google.Maps.Test/TimeZone/TimeZoneServiceTests.cs +++ b/src/Google.Maps.Test/TimeZone/TimeZoneServiceTests.cs @@ -39,6 +39,7 @@ public void OneTimeSetUp() } [Test] + [Category("ValueTesting")] public void TimeZoneService_Works_During_DST() { // Arrange @@ -59,6 +60,7 @@ public void TimeZoneService_Works_During_DST() } [Test] + [Category("ValueTesting")] public void TimeZoneService_Works_Outside_DST() { // Arrange From 1bf0083e824ab4a8787bbb076f462e5267cc843b Mon Sep 17 00:00:00 2001 From: Eric Newton Date: Tue, 26 Dec 2017 14:01:36 -0500 Subject: [PATCH 3/3] appveyor testing updates --- appveyor.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8b37e30..6619348 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,12 +29,22 @@ before_build: build_script: - cmd: msbuild src\GoogleMapsForNET.sln /t:build /p:Configuration=Release /verbosity:minimal -before_test: -#- cmd: curl -isS "https://maps.googleapis.com/maps/api/geocode/json?address=1600+Pennsylvania+Ave+NW%2c+Washington%2c+DC+20500%2c+USA&key=%GOOGLE_API_KEY%" - -after_test: +after_build: - cmd: nuget pack gmaps-api-net.nuspec -version %APPVEYOR_BUILD_VERSION% +test_script: +- ps: >- + + $DLL_LOCATION=".\src\Google.Maps.Test\bin\Release\net461\Google.Maps.Test.dll" + + nunit3-console $DLL_LOCATION --where:"cat!=ValueTesting" "--result=testresults.xml;format=AppVeyor" + + if($? -eq $true) { + + nunit3-console $DLL_LOCATION --where:"cat!=ValueTesting" "--result=testresults2.xml;format=AppVeyor" + + } + artifacts: - path: '*.nupkg' name: NuGetPackage