Exemple #1
0
 public void IsEmptyTest_null()
 {
     SolidColorBrush background = new SolidColorBrush(Color.FromRgb(255, 255, 255));     //Background is irrelevant
     Tile target = new Tile(background);
     target.Piece = null;                // There is now no piece present on the tile
     bool expected = true;              // "True" is therefore expected
     bool actual;
     actual = target.IsEmpty();
     Assert.AreEqual(expected, actual);
 }
Exemple #2
0
 public void IsEmptyTest_notNull()
 {
     SolidColorBrush background = new SolidColorBrush(Color.FromRgb(255, 255, 255));   //Background is irrelevant
     Tile target = new Tile(background);
     target.Piece = PieceBuilder.MakeBishop(new Point(0, 0), Side.Light);              // There is now a piece present on the tile
     bool expected = false;                                                            // "False" is therefore expected
     bool actual;
     actual = target.IsEmpty();
     Assert.AreEqual(expected, actual);
 }
Exemple #3
0
 public void IsOccupiedByTest_side_dark()
 {
     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.Dark); ;    // Piece of side (team) dark is present
     bool expected = false; // "False" is therefore expected
     bool actual;
     actual = target.IsOccupiedBy(side);
     Assert.AreEqual(expected, actual);
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 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);
 }
Exemple #6
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);
 }