public static void TestInEquality_OneIsNull() { Piece piece1 = new Rook(Player.White); Piece piece2 = null; Assert.AreNotEqual(piece1, piece2, "piece1 and piece2 are equal"); Assert.False(piece1.Equals(piece2), "piece1.Equals(piece2) should be false"); Assert.False(piece1 == piece2, "piece1 == piece2 should be false"); Assert.False(piece2 == piece1, "piece2 == piece1 should be false"); Assert.True(piece1 != piece2, "piece1 != piece2 should be True"); Assert.True(piece2 != piece1, "piece2 != piece1 should be True"); piece1 = null; piece2 = new Bishop(Player.Black); Assert.AreNotEqual(piece1, piece2, "piece1 and piece2 are equal"); Assert.False(piece2.Equals(piece1), "piece1.Equals(piece2) should be false"); Assert.False(piece1 == piece2, "piece1 == piece2 should be false"); Assert.False(piece2 == piece1, "piece2 == piece1 should be false"); Assert.True(piece1 != piece2, "piece1 != piece2 should be True"); Assert.True(piece2 != piece1, "piece2 != piece1 should be True"); }
public static void TestInEquality_OneIsNull() { var piece1 = new Rook(Player.White); Piece piece2 = null; Assert.AreNotEqual(piece1, piece2); Assert.False(piece1.Equals(piece2)); Assert.False(piece1 == piece2); Assert.False(piece2 == piece1); Assert.True(piece1 != piece2); Assert.True(piece2 != piece1); piece1 = null; piece2 = new Bishop(Player.Black); Assert.AreNotEqual(piece1, piece2); Assert.False(piece2.Equals(piece1)); Assert.False(piece1 == piece2); Assert.False(piece2 == piece1); Assert.True(piece1 != piece2); Assert.True(piece2 != piece1); }