Skip to content

Commit 9d91791

Browse files
authored
Merge pull request #124 from ericnewton76/fix/dont-test-values
Fix/dont test values
2 parents ffab499 + 1bf0083 commit 9d91791

File tree

8 files changed

+47
-6
lines changed

8 files changed

+47
-6
lines changed

appveyor.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,22 @@ before_build:
2929
build_script:
3030
- cmd: msbuild src\GoogleMapsForNET.sln /t:build /p:Configuration=Release /verbosity:minimal
3131

32-
before_test:
33-
#- 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%"
34-
35-
after_test:
32+
after_build:
3633
- cmd: nuget pack gmaps-api-net.nuspec -version %APPVEYOR_BUILD_VERSION%
3734

35+
test_script:
36+
- ps: >-
37+
38+
$DLL_LOCATION=".\src\Google.Maps.Test\bin\Release\net461\Google.Maps.Test.dll"
39+
40+
nunit3-console $DLL_LOCATION --where:"cat!=ValueTesting" "--result=testresults.xml;format=AppVeyor"
41+
42+
if($? -eq $true) {
43+
44+
nunit3-console $DLL_LOCATION --where:"cat!=ValueTesting" "--result=testresults2.xml;format=AppVeyor"
45+
46+
}
47+
3848
artifacts:
3949
- path: '*.nupkg'
4050
name: NuGetPackage

src/Google.Maps.Test/Direction/DirectionServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void Empty_Address_Fails()
5656
}
5757

5858
[Test]
59-
[Ignore("currentLeg.Duration value keeps changing")]
59+
[Category("ValueTesting")]
6060
public void GetResultForDirections_ex1()
6161
{
6262
// Arrange

src/Google.Maps.Test/Elevation/ElevationServiceTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ public void OneTimeSetUp()
3939
}
4040

4141
[Test]
42+
[Category("ValueTesting")]
43+
public void SHOULD_NOT_RUN()
44+
{
45+
Console.WriteLine("SHOULD NOT RUN!!!");
46+
}
47+
48+
49+
[Test]
50+
[Category("ValueTesting")]
4251
public void GetElevationForOneLocation()
4352
{
4453
// expectations
@@ -63,6 +72,7 @@ public void GetElevationForOneLocation()
6372
}
6473

6574
[Test]
75+
[Category("ValueTesting")]
6676
public void GetElevationForTwoLocations()
6777
{
6878
// expectations

src/Google.Maps.Test/Geocoding/GeocodingRequestTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class GeocodingRequestTests
5151
//}
5252

5353
[Test]
54+
[Category("ValueTesting")]
5455
public void Implicit_Address_set_from_string()
5556
{
5657
var req = new GeocodingRequest();
@@ -63,6 +64,7 @@ public void Implicit_Address_set_from_string()
6364
}
6465

6566
[Test]
67+
[Category("ValueTesting")]
6668
public void LatLng_for_address_will_invoke_reverse_geocoding()
6769
{
6870
var req = new GeocodingRequest();

src/Google.Maps.Test/Geocoding/GeocodingServiceTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public void Empty_address()
5353
}
5454

5555
[Test]
56+
[Category("ValueTesting")]
5657
public void GetGeocodingForAddress1()
5758
{
5859
// Arrange
@@ -81,6 +82,7 @@ public void GetGeocodingForAddress1()
8182
}
8283

8384
[Test]
85+
[Category("ValueTesting")]
8486
public void GetGeocodingForAddress2()
8587
{
8688
// test
@@ -98,6 +100,7 @@ public void GetGeocodingForAddress2()
98100
}
99101

100102
[Test]
103+
[Category("ValueTesting")]
101104
public void Geocode_With_AddressComponent_Locking()
102105
{
103106
var requestGB = new GeocodingRequest
@@ -130,6 +133,7 @@ public void Geocode_With_AddressComponent_Locking()
130133
}
131134

132135
[Test]
136+
[Category("ValueTesting")]
133137
public void Geocode_Without_AddressComponent_Locking()
134138
{
135139
var request = new GeocodingRequest
@@ -146,6 +150,7 @@ public void Geocode_Without_AddressComponent_Locking()
146150
}
147151

148152
[Test]
153+
[Category("ValueTesting")]
149154
public void GeocodeResult_Has_BoundsProperty()
150155
{
151156
var request = new GeocodingRequest
@@ -162,6 +167,7 @@ public void GeocodeResult_Has_BoundsProperty()
162167
}
163168

164169
[Test]
170+
[Category("ValueTesting")]
165171
public void GeocodeResult_Supports_PostalTownAndPostalCodePrefix()
166172
{
167173
var request = new GeocodingRequest
@@ -179,6 +185,7 @@ public void GeocodeResult_Supports_PostalTownAndPostalCodePrefix()
179185
}
180186

181187
[Test]
188+
[Category("ValueTesting")]
182189
public void Utf8_Request_And_Response()
183190
{
184191
var request = new GeocodingRequest

src/Google.Maps.Test/QuickExamplesTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class QuickExamplesTests
1818
{
1919

2020
[Test]
21+
[Category("ValueTesting")]
2122
public void GeocodingRequest_Example()
2223
{
2324
var request = new GeocodingRequest();
@@ -32,6 +33,8 @@ public void GeocodingRequest_Example()
3233
Console.WriteLine("Latitude: " + result.Geometry.Location.Latitude); // 37.4230180
3334
Console.WriteLine("Longitude: " + result.Geometry.Location.Longitude); // -122.0818530
3435

36+
//dont assert on actual values sent from google, these can vary!!!
37+
3538
Assert.Pass();
3639
}
3740

@@ -45,10 +48,13 @@ public void StaticMapRequest_Example()
4548

4649
var imgTagSrc = map.ToUri();
4750

48-
Assert.Pass();
51+
//check program functional outputs, not google's returned values
52+
53+
Assert.That(imgTagSrc.Query.Contains("zoom=14"));
4954
}
5055

5156
[Test]
57+
[Category("ValueTesting")]
5258
public void PartialMatchTest()
5359
{
5460
// invalid address results in partial match

src/Google.Maps.Test/TimeZone/TimeZoneServiceTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public void OneTimeSetUp()
3939
}
4040

4141
[Test]
42+
[Category("ValueTesting")]
4243
public void TimeZoneService_Works_During_DST()
4344
{
4445
// Arrange
@@ -59,6 +60,7 @@ public void TimeZoneService_Works_During_DST()
5960
}
6061

6162
[Test]
63+
[Category("ValueTesting")]
6264
public void TimeZoneService_Works_Outside_DST()
6365
{
6466
// Arrange

src/GoogleMapsForNET.sln

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Maps.Test", "Google.
1313
EndProject
1414
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{81703210-2D39-4A33-8F6B-7E1689F65B9E}"
1515
EndProject
16+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{9C1B8BBB-362C-4D4B-8D94-FBA657706AE6}"
17+
EndProject
1618
Global
1719
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1820
Debug|Any CPU = Debug|Any CPU
@@ -40,6 +42,8 @@ Global
4042
EndGlobalSection
4143
GlobalSection(NestedProjects) = preSolution
4244
{D98DFE5A-BB2C-4439-A0F6-B4E64987DDDE} = {B74E7466-5EBB-4FB1-9AF0-B0C57C139612}
45+
{C2E1656D-A708-4240-8E67-EA97BAD208F4} = {9C1B8BBB-362C-4D4B-8D94-FBA657706AE6}
46+
{81703210-2D39-4A33-8F6B-7E1689F65B9E} = {B74E7466-5EBB-4FB1-9AF0-B0C57C139612}
4347
EndGlobalSection
4448
GlobalSection(ExtensibilityGlobals) = postSolution
4549
SolutionGuid = {2C033920-B14E-4E99-BE83-45EC87FEA965}

0 commit comments

Comments
 (0)