hot fix
continuous-integration/drone/push Build is failing Details

test_old_branch
Jérémy Mouyon 12 months ago
parent 0fcbbddb76
commit decb615fec

@ -3,59 +3,60 @@ namespace TestBase;
namespace TestBase namespace TestBase
{ {
public class TestBoard public class TestBoard
{
public static IEnumerable<object[]> Data_Board()
{ {
yield return new object[] public static IEnumerable<object[]> Data_Board()
{ {
yield return new object[]
{
true, true,
1, 1,
2, 2,
new Tile(Shape.Round, Color.Red) new Tile(Shape.Round, Color.Red)
}; };
yield return new object[] yield return new object[]
{ {
false, false,
-5, -5,
9999, 9999,
new Tile(Shape.Round, Color.Red) new Tile(Shape.Round, Color.Red)
}; };
} }
[Theory] [Theory]
[MemberData(nameof(Data_Board))] [MemberData(nameof(Data_Board))]
public void Test_BoardAddSolo(bool except, int x, int y, Tile t) public void Test_BoardAddSolo(bool except, int x, int y, Tile t)
{ {
Board b = new Board(); Board b = new Board();
if (!except) if (!except)
{ {
Assert.False(b.AddTileInCell(x, y, t)); Assert.False(b.AddTileInCell(x, y, t));
return; return;
}
Assert.True(b.AddTileInCell(x, y, t));
} }
Assert.True(b.AddTileInCell(x, y, t));
}
public static IEnumerable<object[]> Data_BoardDouble() public static IEnumerable<object[]> Data_BoardDouble()
{
yield return new object[]
{ {
yield return new object[]
{
1, 1,
2, 2,
new Tile(Shape.Round, Color.Red) new Tile(Shape.Round, Color.Red)
}; };
} }
[Theory] [Theory]
[MemberData(nameof(Data_BoardDouble))] [MemberData(nameof(Data_BoardDouble))]
public void Test_BoardFree(int x, int y, Tile t) public void Test_BoardFree(int x, int y, Tile t)
{ {
Board board = new Board(); Board board = new Board();
board.AddTileInCell(x, y, t); board.AddTileInCell(x, y, t);
Assert.False(board.AddTileInCell(x,y, t)); Assert.False(board.AddTileInCell(x, y, t));
}
} }
} }

Loading…
Cancel
Save