Skip to content

Commit b6d5c37

Browse files
committed
Fixing tests after merginng position constructor validtion change
1 parent 8c2f167 commit b6d5c37

File tree

6 files changed

+50
-49
lines changed

6 files changed

+50
-49
lines changed

src/GeoJSON.Net.Tests/Feature/FeatureTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,19 @@ public void Can_Serialize_MultiPolygon_Feature()
143143
{
144144
new LineString(new List<IPosition>
145145
{
146-
new Position(100, 100),
147-
new Position(100, 101),
148-
new Position(101, 101),
149-
new Position(101, 100),
150-
new Position(100, 100)
146+
new Position(70, 70),
147+
new Position(70, 71),
148+
new Position(71, 71),
149+
new Position(71, 70),
150+
new Position(70, 70)
151151
}),
152152
new LineString(new List<IPosition>
153153
{
154-
new Position(200, 200),
155-
new Position(200, 201),
156-
new Position(201, 201),
157-
new Position(201, 200),
158-
new Position(200, 200)
154+
new Position(80, 80),
155+
new Position(80, 81),
156+
new Position(81, 81),
157+
new Position(81, 80),
158+
new Position(80, 80)
159159
})
160160
})
161161
});
@@ -315,7 +315,7 @@ public void Feature_Equals_Null_Issue94()
315315
bool equal1 = true;
316316
bool equal2 = true;
317317

318-
var feature = new Net.Feature.Feature(new Point(new Position(123, 12)));
318+
var feature = new Net.Feature.Feature(new Point(new Position(12, 123)));
319319
Assert.DoesNotThrow(() =>
320320
{
321321
equal1 = feature.Equals(null);
@@ -346,7 +346,7 @@ public void Feature_Equals_Itself_Issue94()
346346
bool equal1 = false;
347347
bool equal2 = false;
348348

349-
var feature = new Net.Feature.Feature(new Point(new Position(123, 12)));
349+
var feature = new Net.Feature.Feature(new Point(new Position(12, 123)));
350350
Assert.DoesNotThrow(() =>
351351
{
352352
equal1 = feature == feature;

src/GeoJSON.Net.Tests/Feature/FeatureTests_Can_Serialize_MultiPolygon_Feature.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
],
1313
[
1414
[
15-
[100.0, 100.0],
16-
[101.0, 100.0],
17-
[101.0, 101.0],
18-
[100.0, 101.0],
19-
[100.0, 100.0]
15+
[70.0, 70.0],
16+
[71.0, 70.0],
17+
[71.0, 71.0],
18+
[70.0, 71.0],
19+
[70.0, 70.0]
2020
],
2121
[
22-
[200.0, 200.0],
23-
[201.0, 200.0],
24-
[201.0, 201.0],
25-
[200.0, 201.0],
26-
[200.0, 200.0]
22+
[80.0, 80.0],
23+
[81.0, 80.0],
24+
[81.0, 81.0],
25+
[80.0, 81.0],
26+
[80.0, 80.0]
2727
]
2828
]
2929
],

src/GeoJSON.Net.Tests/Feature/GenericFeatureTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void Feature_Generic_Equals_Null_Issure94()
6363
bool equal1 = true;
6464
bool equal2 = true;
6565

66-
var point = new Point(new Position(123, 34));
66+
var point = new Point(new Position(34, 123));
6767
var properties = new Dictionary<string, string>
6868
{
6969
{"test1", "test1val"},

src/GeoJSON.Net.Tests/Geometry/MultiPolygonTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@ public void Can_Serialize()
8181
{
8282
new LineString(new List<IPosition>
8383
{
84-
new Position(100, 100),
85-
new Position(100, 101),
86-
new Position(101, 101),
87-
new Position(101, 100),
88-
new Position(100, 100)
84+
new Position(60, 60),
85+
new Position(60, 61),
86+
new Position(61, 61),
87+
new Position(61, 60),
88+
new Position(60, 60)
8989
}),
9090
new LineString(new List<IPosition>
9191
{
92-
new Position(200, 200),
93-
new Position(200, 201),
94-
new Position(201, 201),
95-
new Position(201, 200),
96-
new Position(200, 200)
92+
new Position(70, 70),
93+
new Position(71, 70),
94+
new Position(71, 71),
95+
new Position(70, 71),
96+
new Position(70, 70)
9797
})
9898
});
9999

src/GeoJSON.Net.Tests/Geometry/MultiPolygonTests_Can_Serialize.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
],
1212
[
1313
[
14-
[100.0, 100.0],
15-
[101.0, 100.0],
16-
[101.0, 101.0],
17-
[100.0, 101.0],
18-
[100.0, 100.0]
14+
[60.0, 60.0],
15+
[61.0, 60.0],
16+
[61.0, 61.0],
17+
[60.0, 61.0],
18+
[60.0, 60.0]
1919
],
2020
[
21-
[200.0, 200.0],
22-
[201.0, 200.0],
23-
[201.0, 201.0],
24-
[200.0, 201.0],
25-
[200.0, 200.0]
21+
[70.0, 70.0],
22+
[70.0, 71.0],
23+
[71.0, 71.0],
24+
[71.0, 70.0],
25+
[70.0, 70.0]
2626
]
2727
]
2828
],

src/GeoJSON.Net.Tests/Geometry/PolygonTests.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,13 @@ public void Can_Deserialize()
266266
[Test]
267267
public void Equals_GetHashCode_Contract()
268268
{
269-
var rnd = new System.Random();
270-
var offset = rnd.NextDouble() * 60;
271-
if (rnd.NextDouble() < 0.5)
272-
{
273-
offset *= -1;
274-
}
269+
//var rnd = new System.Random();
270+
//var offset = rnd.NextDouble() * 60;
271+
//if (rnd.NextDouble() < 0.5)
272+
//{
273+
// offset *= -1;
274+
//}
275+
double offset = 0d;
275276

276277
var left = GetPolygon(offset);
277278
var right = GetPolygon(offset);

0 commit comments

Comments
 (0)