fix smellll

test_old_branch
Jérémy Mouyon 11 months ago
parent b5c8941580
commit dfe2a8aea9

File diff suppressed because it is too large Load Diff

@ -6,26 +6,28 @@ namespace TestBase;
public class TestBoard public class TestBoard
{ {
public static IEnumerable<object[]> Data_Board() public static TheoryData<bool, int, int, Tile> DataBoard()
{ {
yield return new object[] var data = new TheoryData<bool, int, int, Tile>
{ {
true, {
1, true,
2, 1,
new Tile(Shape.Round, Color.Red) 2,
}; new Tile(Shape.Round, Color.Red)
yield return new object[] },
{ {
false, false,
-5, -5,
9999, 9999,
new Tile(Shape.Round, Color.Red) new Tile(Shape.Round, Color.Red)
}
}; };
return data;
} }
[Theory] [Theory]
[MemberData(nameof(Data_Board))] [MemberData(nameof(DataBoard))]
public void Test_BoardAddSolo(bool except, int x, int y, Tile t) public void Test_BoardAddSolo(bool except, int x, int y, Tile t)
{ {
@ -40,14 +42,18 @@ public class TestBoard
Assert.True(b.AddTileInCell(x, y, t)); Assert.True(b.AddTileInCell(x, y, t));
} }
public static IEnumerable<object[]> Data_BoardDouble() public static TheoryData<int, int, Tile> Data_BoardDouble()
{ {
yield return new object[] var data = new TheoryData<int, int, Tile>
{ {
1, {
2, 1,
new Tile(Shape.Round, Color.Red) 2,
new Tile(Shape.Round, Color.Red)
}
}; };
return data;
} }
[Theory] [Theory]

@ -45,7 +45,7 @@ public class TestGame
if (!result) if (!result)
{ {
players.Add(p); players.Add(p!);
Assert.False(game.AddPlayerInGame(players)); Assert.False(game.AddPlayerInGame(players));
} }

@ -11,7 +11,7 @@ public class TestScore
DateTime now = DateTime.Today; DateTime now = DateTime.Today;
Score score = new Score(p.NameTag, now, 0, 0); Score score = new Score(p.NameTag, now, 0, 0);
Assert.True(score.PlayerName == "test"); Assert.Equal("test", score.PlayerName);
} }
[Fact] [Fact]

@ -8,26 +8,29 @@ using System.Threading.Tasks;
namespace TestBase namespace TestBase
{ {
public class TestTile public class TestTile
{
[Fact]
public void TestCreateCorrect()
{
Tile t = new Tile(Shape.Star, Color.Blue);
Assert.NotNull(t);
Assert.Equal(Shape.Star, t.GetShape);
Assert.Equal(Color.Blue, t.GetColor);
}
public static TheoryData<Tile> Data_Tile()
{
var data = new TheoryData<Tile>
{ {
[Fact]
public void TestCreateCorrect()
{
Tile t = new Tile(Shape.Star, Color.Blue);
Assert.NotNull(t);
Assert.Equal(Shape.Star, t.GetShape);
Assert.Equal(Color.Blue, t.GetColor);
}
public static IEnumerable<object[]> Data_Tile()
{ {
yield return new object[]
{
new Tile(Shape.Round, Color.Green) new Tile(Shape.Round, Color.Green)
}; },
yield return new object[] {
{
new Tile(Shape.Shuriken, Color.Red) new Tile(Shape.Shuriken, Color.Red)
};
} }
};
return data;
}
[Theory] [Theory]
[MemberData(nameof(Data_Tile))] [MemberData(nameof(Data_Tile))]

Loading…
Cancel
Save