public void TestInequality() { var one = new Rotation2d(Angle.FromDegrees(42)); var two = new Rotation2d(Angle.FromDegrees(42.5)); Assert.False(one.Equals(two)); }
public void TestEquality(float radians) { var rot1 = new Rotation2d(radians); var rot2 = new Rotation2d(radians); Assert.True(rot1 == rot2); Assert.True(rot1.Equals(rot2)); rot1.Radians += Constants.FloatTolerance / 10; Assert.True(rot1 == rot2); Assert.True(rot1.Equals(rot2)); rot1.Radians += Constants.FloatTolerance * 10; Assert.False(rot1 == rot2); Assert.False(rot1.Equals(rot2)); }