|
@ -12,19 +12,32 @@ namespace MiniGamesTests |
|
|
public class SchereSteinPapierEchseSpockTest |
|
|
public class SchereSteinPapierEchseSpockTest |
|
|
{ |
|
|
{ |
|
|
SchereSteinPapierEchseSpock Spiel = new(); |
|
|
SchereSteinPapierEchseSpock Spiel = new(); |
|
|
|
|
|
SchereSteinPapierEchseSpockModel SpieleModel = new(); |
|
|
|
|
|
private const string stein = "Stein"; |
|
|
|
|
|
private const string schere = "Schere"; |
|
|
|
|
|
private const string papier = "Papier"; |
|
|
|
|
|
private const string echse = "Echse"; |
|
|
|
|
|
private const string spock = "Spock"; |
|
|
|
|
|
|
|
|
|
|
|
private const string gewonnen = "Gewonnen"; |
|
|
|
|
|
private const string verloren = "Verloren"; |
|
|
|
|
|
private const string unentschieden = "Unentschieden"; |
|
|
|
|
|
|
|
|
[Theory] |
|
|
[Theory] |
|
|
[InlineData(0, 0, "Unentschieden")] |
|
|
|
|
|
public void IsStone(int hand, int gegnerHand, string erwartet) |
|
|
|
|
|
|
|
|
[InlineData(stein, stein, unentschieden)] |
|
|
|
|
|
[InlineData(stein, schere, gewonnen)] |
|
|
|
|
|
[InlineData(stein, papier, verloren)] |
|
|
|
|
|
[InlineData(stein, echse, gewonnen)] |
|
|
|
|
|
[InlineData(stein, spock, verloren)] |
|
|
|
|
|
public void IsStone(string hand, string gegner, string erwartet) |
|
|
{ |
|
|
{ |
|
|
//arrange
|
|
|
//arrange
|
|
|
int handId = hand; |
|
|
|
|
|
int gegnerId = gegnerHand; |
|
|
|
|
|
|
|
|
string spielerHand = hand; |
|
|
|
|
|
string gegnerHand = gegner; |
|
|
string erwartetesErg = erwartet; |
|
|
string erwartetesErg = erwartet; |
|
|
|
|
|
|
|
|
//act
|
|
|
//act
|
|
|
string getestetesErg = Spiel.SpielerStein(handId, gegnerId); |
|
|
|
|
|
|
|
|
string getestetesErg = Spiel.SpielerStein(spielerHand, gegnerHand); |
|
|
|
|
|
|
|
|
//assert
|
|
|
//assert
|
|
|
Assert.Equal(erwartetesErg, getestetesErg); |
|
|
Assert.Equal(erwartetesErg, getestetesErg); |
|
|