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 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,
2,
new Tile(Shape.Round, Color.Red)
};
yield return new object[]
{
false,
-5,
9999,
new Tile(Shape.Round, Color.Red)
{
true,
1,
2,
new Tile(Shape.Round, Color.Red)
},
{
false,
-5,
9999,
new Tile(Shape.Round, Color.Red)
}
};
return data;
}
[Theory]
[MemberData(nameof(Data_Board))]
[MemberData(nameof(DataBoard))]
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));
}
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,
new Tile(Shape.Round, Color.Red)
{
1,
2,
new Tile(Shape.Round, Color.Red)
}
};
return data;
}
[Theory]

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

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

@ -8,26 +8,29 @@ using System.Threading.Tasks;
namespace TestBase
{
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)
};
yield return new object[]
{
},
{
new Tile(Shape.Shuriken, Color.Red)
};
}
};
return data;
}
[Theory]
[MemberData(nameof(Data_Tile))]

Loading…
Cancel
Save