|
@ -10,6 +10,22 @@ namespace MiniGamesTests |
|
|
{ |
|
|
{ |
|
|
public class TicTacToeBrettTest |
|
|
public class TicTacToeBrettTest |
|
|
{ |
|
|
{ |
|
|
|
|
|
public TicTacToeBrett TestBrett( |
|
|
|
|
|
int a = -1, int b = -1, int c = -1, |
|
|
|
|
|
int d = -1, int e = -1, int f = -1, |
|
|
|
|
|
int g = -1, int h = -1, int i = -1 |
|
|
|
|
|
) |
|
|
|
|
|
{ |
|
|
|
|
|
return new( |
|
|
|
|
|
new int[,] |
|
|
|
|
|
{ |
|
|
|
|
|
{ a, b, c, }, |
|
|
|
|
|
{ d, e, f, }, |
|
|
|
|
|
{ g, h, i, }, |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Theory] |
|
|
[Theory] |
|
|
[InlineData(4, 0, true)] |
|
|
[InlineData(4, 0, true)] |
|
|
public void Set_FreiesFeldBelegenTest(int pos, int wert, bool gesetzt) |
|
|
public void Set_FreiesFeldBelegenTest(int pos, int wert, bool gesetzt) |
|
@ -26,7 +42,7 @@ namespace MiniGamesTests |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
public void Gleich_LeereBretterTest() |
|
|
|
|
|
|
|
|
public void Gleich_LeereBretterGleichTest() |
|
|
{ |
|
|
{ |
|
|
// arrange
|
|
|
// arrange
|
|
|
TicTacToeBrett b1 = new(); |
|
|
TicTacToeBrett b1 = new(); |
|
@ -39,5 +55,20 @@ namespace MiniGamesTests |
|
|
// assert
|
|
|
// assert
|
|
|
Assert.Equal(erwartetGleich, erhaltenGleich); |
|
|
Assert.Equal(erwartetGleich, erhaltenGleich); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void Gleich_NichtLeereBretterUngleichTest() |
|
|
|
|
|
{ |
|
|
|
|
|
// arrange
|
|
|
|
|
|
TicTacToeBrett b1 = TestBrett(1); |
|
|
|
|
|
TicTacToeBrett b2 = TestBrett(2); |
|
|
|
|
|
bool erwartetGleich = false; |
|
|
|
|
|
|
|
|
|
|
|
// act
|
|
|
|
|
|
bool erhaltenGleich = b1.Gleich(b2); |
|
|
|
|
|
|
|
|
|
|
|
// assert
|
|
|
|
|
|
Assert.Equal(erwartetGleich, erhaltenGleich); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |