Browse Source

TicTacToeBrett.Gewinner-Test für nicht volle Reihen

feature/tictactoe
Felix Detig 3 years ago
parent
commit
f71d96b739
  1. 38
      BlazorSolution/MiniGamesTests/TicTacToeBrettTest.cs

38
BlazorSolution/MiniGamesTests/TicTacToeBrettTest.cs

@ -263,5 +263,43 @@ namespace MiniGamesTests
// assert
Assert.Equal(erwarteterGewinner, erhaltenerGewinner);
}
[Theory]
[InlineData(
0, TicTacToeBrett.LEER, 0,
TicTacToeBrett.LEER, TicTacToeBrett.LEER, TicTacToeBrett.LEER,
0, TicTacToeBrett.LEER, 0
)]
[InlineData(
1, 1, TicTacToeBrett.LEER,
1, 1, TicTacToeBrett.LEER,
TicTacToeBrett.LEER, TicTacToeBrett.LEER, TicTacToeBrett.LEER
)]
[InlineData(
2, TicTacToeBrett.LEER, TicTacToeBrett.LEER,
2, TicTacToeBrett.LEER, 2,
TicTacToeBrett.LEER, 2, 2
)]
[InlineData(
1, 1, 2,
1, 3, 2,
2, 3, 3
)]
public void Gewinner_NichtVolleReihenTest(
int a = TicTacToeBrett.LEER, int b = TicTacToeBrett.LEER, int c = TicTacToeBrett.LEER,
int d = TicTacToeBrett.LEER, int e = TicTacToeBrett.LEER, int f = TicTacToeBrett.LEER,
int g = TicTacToeBrett.LEER, int h = TicTacToeBrett.LEER, int i = TicTacToeBrett.LEER
)
{
// arrange
TicTacToeBrett brett = TestBrett(a, b, c, d, e, f, g, h, i);
int erwarteterGewinner = TicTacToeBrett.LEER;
// act
int erhaltenerGewinner = brett.Gewinner();
// assert
Assert.Equal(erwarteterGewinner, erhaltenerGewinner);
}
}
}
Loading…
Cancel
Save