Skip to content

Commit dea616d

Browse files
committed
Expand this new test to ensure that the unit is read properly.
1 parent cc3682f commit dea616d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/ProjNet.Tests/WKT/WKTCoordSysParserTests.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,14 @@ public void ParseWktCreatedByCoordinateSystem()
440440
"UNIT[\"Meter\", 1]" +
441441
"]";
442442

443-
var csFromSample = (CoordinateSystem)ProjNet.IO.CoordinateSystems.CoordinateSystemWktReader.Parse(sampleWKT); // does not throw
443+
var csFromSample = (CoordinateSystem)ProjNet.IO.CoordinateSystems.CoordinateSystemWktReader.Parse(sampleWKT);
444444
string wktFromProjNetCS = csFromSample.WKT;
445-
var csFromProjNetGeneratedWKT = (CoordinateSystem)ProjNet.IO.CoordinateSystems.CoordinateSystemWktReader.Parse(wktFromProjNetCS); // throws
445+
var parsed = ProjNet.IO.CoordinateSystems.CoordinateSystemWktReader.Parse(wktFromProjNetCS);
446+
Assert.That(parsed, Is.InstanceOf<ProjectedCoordinateSystem>());
447+
var projCS = (ProjectedCoordinateSystem)parsed;
448+
Assert.That(projCS.LinearUnit, Is.Not.Null);
449+
Assert.That(projCS.LinearUnit.Name, Is.EqualTo("Meter"));
450+
Assert.That(projCS.LinearUnit.MetersPerUnit, Is.EqualTo(1));
446451
}
447452

448453

0 commit comments

Comments
 (0)