Skip to content

Commit

Permalink
Merge pull request #124 from ericnewton76/fix/dont-test-values
Browse files Browse the repository at this point in the history
Fix/dont test values
  • Loading branch information
ericnewton76 committed Dec 26, 2017
2 parents ffab499 + 1bf0083 commit 9d91791
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 6 deletions.
18 changes: 14 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Google.Maps.Test/Direction/DirectionServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void Empty_Address_Fails()
}

[Test]
[Ignore("currentLeg.Duration value keeps changing")]
[Category("ValueTesting")]
public void GetResultForDirections_ex1()
{
// Arrange
Expand Down
10 changes: 10 additions & 0 deletions src/Google.Maps.Test/Elevation/ElevationServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -63,6 +72,7 @@ public void GetElevationForOneLocation()
}

[Test]
[Category("ValueTesting")]
public void GetElevationForTwoLocations()
{
// expectations
Expand Down
2 changes: 2 additions & 0 deletions src/Google.Maps.Test/Geocoding/GeocodingRequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class GeocodingRequestTests
//}

[Test]
[Category("ValueTesting")]
public void Implicit_Address_set_from_string()
{
var req = new GeocodingRequest();
Expand All @@ -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();
Expand Down
7 changes: 7 additions & 0 deletions src/Google.Maps.Test/Geocoding/GeocodingServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public void Empty_address()
}

[Test]
[Category("ValueTesting")]
public void GetGeocodingForAddress1()
{
// Arrange
Expand Down Expand Up @@ -81,6 +82,7 @@ public void GetGeocodingForAddress1()
}

[Test]
[Category("ValueTesting")]
public void GetGeocodingForAddress2()
{
// test
Expand All @@ -98,6 +100,7 @@ public void GetGeocodingForAddress2()
}

[Test]
[Category("ValueTesting")]
public void Geocode_With_AddressComponent_Locking()
{
var requestGB = new GeocodingRequest
Expand Down Expand Up @@ -130,6 +133,7 @@ public void Geocode_With_AddressComponent_Locking()
}

[Test]
[Category("ValueTesting")]
public void Geocode_Without_AddressComponent_Locking()
{
var request = new GeocodingRequest
Expand All @@ -146,6 +150,7 @@ public void Geocode_Without_AddressComponent_Locking()
}

[Test]
[Category("ValueTesting")]
public void GeocodeResult_Has_BoundsProperty()
{
var request = new GeocodingRequest
Expand All @@ -162,6 +167,7 @@ public void GeocodeResult_Has_BoundsProperty()
}

[Test]
[Category("ValueTesting")]
public void GeocodeResult_Supports_PostalTownAndPostalCodePrefix()
{
var request = new GeocodingRequest
Expand All @@ -179,6 +185,7 @@ public void GeocodeResult_Supports_PostalTownAndPostalCodePrefix()
}

[Test]
[Category("ValueTesting")]
public void Utf8_Request_And_Response()
{
var request = new GeocodingRequest
Expand Down
8 changes: 7 additions & 1 deletion src/Google.Maps.Test/QuickExamplesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class QuickExamplesTests
{

[Test]
[Category("ValueTesting")]
public void GeocodingRequest_Example()
{
var request = new GeocodingRequest();
Expand All @@ -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();
}

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/Google.Maps.Test/TimeZone/TimeZoneServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void OneTimeSetUp()
}

[Test]
[Category("ValueTesting")]
public void TimeZoneService_Works_During_DST()
{
// Arrange
Expand All @@ -59,6 +60,7 @@ public void TimeZoneService_Works_During_DST()
}

[Test]
[Category("ValueTesting")]
public void TimeZoneService_Works_Outside_DST()
{
// Arrange
Expand Down
4 changes: 4 additions & 0 deletions src/GoogleMapsForNET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 9d91791

Please sign in to comment.