public void OccupiedByTest_type_pawn() { SolidColorBrush background = new SolidColorBrush(Color.FromRgb(255, 255, 255)); //Background is irrelevant Tile target = new Tile(background); PieceType type = PieceType.Pawn; // Ask if the tile is occupied by a piece of type pawn target.Piece = PieceBuilder.MakePawn(new Point(0,0), Side.Light); // Pawn present bool expected = true; // "True" is therefore expected bool actual; actual = target.OccupiedBy(type); Assert.AreEqual(expected, actual); }
public void OccupiedByTest_type_null() { SolidColorBrush background = new SolidColorBrush(Color.FromRgb(255, 255, 255)); //Background is irrelevant Tile target = new Tile(background); PieceType type = PieceType.Pawn; // Ask if the tile is occupied by a piece of type pawn target.Piece = null; // No piece is present bool expected = false; // "False" is therefore expected bool actual; actual = target.OccupiedBy(type); Assert.AreEqual(expected, actual); }