private void AssertEqualCoordinates(CrsCoordinate coordinate1, CrsCoordinate coordinate2) { Assert.AreEqual(coordinate1.XEastingLongitude, coordinate2.XEastingLongitude, deltaTolerance); Assert.AreEqual(coordinate1.YNorthingLatitude, coordinate2.YNorthingLatitude, deltaTolerance); Assert.AreEqual(coordinate1.CrsIdentifier, coordinate2.CrsIdentifier); // data class Assert.AreEqual(coordinate1.CrsIdentifier.EpsgNumber, coordinate2.CrsIdentifier.EpsgNumber); Assert.AreEqual(coordinate1.GetHashCode(), coordinate2.GetHashCode()); Assert.AreEqual(coordinate1, coordinate2); }
public void CoordinateWithNineDecimals_ShouldBeEqualToCoordinateConstructedWithTheSameValues_WhenTheOnlyDifferenceIsSomeAdditionalZeroes() { CrsCoordinate c1 = CrsCoordinateFactory.CreateFromLatitudeLongitude(59.123456789, 18.123456789000); CrsCoordinate c2 = CrsCoordinateFactory.CreateFromLatitudeLongitude(59.123456789000, 18.123456789); Assert.AreEqual( c1, c2 ); Assert.AreEqual( c1.GetHashCode(), c2.GetHashCode() ); }