0 smell ? yes !
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 11 months ago
parent 028de27909
commit 697c2e2e55

@ -45,14 +45,15 @@ public class TestBoard
Assert.True(b.AddTileInCell(x, y, t));
}
public static TheoryData<int, int, Tile> Data_BoardDouble()
public static TheoryData<int, int, Shape, Color> Data_BoardDouble()
{
var data = new TheoryData<int, int, Tile>
var data = new TheoryData<int, int, Shape, Color>
{
{
1,
2,
new Tile(Shape.Round, Color.Red)
Shape.Round,
Color.Red
}
};
@ -61,8 +62,9 @@ public class TestBoard
[Theory]
[MemberData(nameof(Data_BoardDouble))]
public void Test_BoardFree(int x, int y, Tile t)
public void Test_BoardFree(int x, int y, Shape s, Color c)
{
Tile t = new(s, c);
Board board = new Board(12, 12);
board.AddTileInCell(x, y, t);
Assert.False(board.AddTileInCell(x, y, t));
@ -93,8 +95,6 @@ public class TestBoard
}
Assert.False(board.HasOccupiedCase());
return;
}
[Theory]
@ -112,8 +112,6 @@ public class TestBoard
}
Assert.Null(board.GetCell(900, 900));
return;
}
[Fact]
public void Test_EventBoard()

@ -23,27 +23,36 @@ public class TestCell
Assert.Equal(y, c.GetY);
}
public static IEnumerable<object[]> Data_Cell()
public static TheoryData<bool, int, int, Shape, Color> Data_Cell()
{
yield return new object[]
{
true,
new Cell(0,0),
new Tile(Shape.Round, Color.Red)
};
yield return new object[]
var data = new TheoryData<bool, int, int, Shape, Color>
{
false,
new Cell(0,0),
new Tile(Shape.Round, Color.Red)
{
true,
0,
0,
Shape.Round,
Color.Red
},
{
false,
0,
0,
Shape.Round,
Color.Red
}
};
return data;
}
[Theory]
[MemberData(nameof(Data_Cell))]
public void Test_CellSetTile(bool except, Cell c, Tile t)
public void Test_CellSetTile(bool except, int x, int y, Shape shape, Color color)
{
Tile t = new(shape, color);
Cell c = new(x, y);
if (!except)
{
c.SetTile(t);
@ -55,9 +64,12 @@ public class TestCell
[Theory]
[MemberData(nameof(Data_Cell))]
public void Test_IsFree(bool except, Cell c, Tile t)
public void Test_IsFree(bool except, int x, int y, Shape shape, Color color)
{
if (except == false)
Tile t = new(shape, color);
Cell c = new(x, y);
if (!except)
{
c.SetTile(t);
Assert.False(c.IsFree);

@ -18,15 +18,18 @@ namespace TestBase
Assert.Equal(Color.Blue, t.GetColor);
}
public static TheoryData<Tile> Data_Tile()
public static TheoryData<Shape, Color> Data_Tile()
{
var data = new TheoryData<Tile>
var data = new TheoryData<Shape, Color>
{
{
new Tile(Shape.Round, Color.Green)
Shape.Round,
Color.Green
},
{
new Tile(Shape.Shuriken, Color.Red)
Shape.Shuriken,
Color.Red
}
};
return data;
@ -34,8 +37,11 @@ namespace TestBase
[Theory]
[MemberData(nameof(Data_Tile))]
public void Test_Name(Tile t)
public void Test_Name(Shape shape, Color color)
{
Tile t = new(shape, color);
Shape s = t.GetShape;
Color c = t.GetColor;
string str = (c.ToString() + s.ToString());

Loading…
Cancel
Save