public void TwoPathsWithTheSamePointsAndInTheSameOrderShouldBeEquals() { var listPoints = new List<SimplePoint> { new SimplePoint(10, 20), new SimplePoint(15, 20), new SimplePoint(15, 18), new SimplePoint(20, 20), new SimplePoint(15, 25) }; var testPath1 = new Path(listPoints); var testPath2 = new Path(listPoints); testPath1.Equals(testPath2).Should().Be(true); }
public void TwoPathsWithTheSamePointsButInDifferentOrderShouldNotBeEquals() { var listPoints = new List<SimplePoint> { new SimplePoint(10, 20), new SimplePoint(15, 20), new SimplePoint(15, 18), new SimplePoint(20, 20), new SimplePoint(15, 25) }; var reversedPointList = listPoints.Reverse<SimplePoint>().ToList(); var testPath1 = new Path(listPoints); var testPath2 = new Path(reversedPointList); testPath1.Equals(testPath2).Should().Be(false); }
public void TwoPathsWithTheDifferentPointsShouldNotBeEquals() { var listPoints1 = new List<SimplePoint> { new SimplePoint(10, 20), new SimplePoint(15, 20), new SimplePoint(15, 18), new SimplePoint(20, 20), new SimplePoint(15, 25) }; var listPoints2 = new List<SimplePoint> { new SimplePoint(10, 20), new SimplePoint(15, 20), new SimplePoint(20, 20), new SimplePoint(15, 25) }; var listPoints3 = new List<SimplePoint> { new SimplePoint(10, 20), new SimplePoint(15, 20), new SimplePoint(15, 17), new SimplePoint(20, 20), new SimplePoint(15, 25) }; var testPath1 = new Path(listPoints1); var testPath2 = new Path(listPoints2); var testPath3 = new Path(listPoints3); testPath1.Equals(testPath2).Should().Be(false); testPath1.Equals(testPath3).Should().Be(false); testPath2.Equals(testPath3).Should().Be(false); }