示例#1
0
 public void IsOccupiedByTest_side_light()
 {
     SolidColorBrush background = new SolidColorBrush(Color.FromRgb(255, 255, 255)); //Background is irrelevant
     Tile target = new Tile(background);
     Side side = Side.Light; // Ask if the tile is occupied by a light piece
     target.Piece = PieceBuilder.MakeBishop(new Point(0, 0), Side.Light); ;    // Piece of side (team) light is present
     bool expected = true; // "True" is therefore expected
     bool actual;
     actual = target.IsOccupiedBy(side);
     Assert.AreEqual(expected, actual);
 }
示例#2
0
 public void IsOccupiedByTest_side_null()
 {
     SolidColorBrush background = new SolidColorBrush(Color.FromRgb(255, 255, 255)); //Background is irrelevant
     Tile target = new Tile(background);
     Side side = Side.Light; // Ask if the tile is occupied by a light piece
     target.Piece = null;    // Piece is null (no piece present)
     bool expected = false; // "False" is therefore expected
     bool actual;
     actual = target.IsOccupiedBy(side);
     Assert.AreEqual(expected, actual);
 }