Browse Source

test für CPU hand

feature/scheresteinpapier
ADato88 3 years ago
parent
commit
9bacabacb3
  1. 5
      BlazorSolution/MiniGames/Client/ViewModel/SchereSteinPapierEchseSpock.cs
  2. 19
      BlazorSolution/MiniGamesTests/SchereSteinPapierEchseSpockTest.cs

5
BlazorSolution/MiniGames/Client/ViewModel/SchereSteinPapierEchseSpock.cs

@ -86,5 +86,10 @@ namespace MiniGames.Client.ViewModel
return RegelModel.erg[2]; return RegelModel.erg[2];
} }
} }
public string CPUHand(int index)
{
return RegelModel.hand[index];
}
} }
} }

19
BlazorSolution/MiniGamesTests/SchereSteinPapierEchseSpockTest.cs

@ -122,5 +122,24 @@ namespace MiniGamesTests
//assert //assert
Assert.Equal(erwartetesErg, getestetesErg); Assert.Equal(erwartetesErg, getestetesErg);
} }
[Theory]
[InlineData(0, stein)]
[InlineData(1, schere)]
[InlineData(2, papier)]
[InlineData(3, echse)]
[InlineData(4, spock)]
public void PChand(int index, string erwartet)
{
//arrange
int _index = index;
string _erwartet = erwartet;
//act
string erg = Spiel.CPUHand(_index);
//assert
Assert.Equal(_erwartet, erg);
}
} }
} }
Loading…
Cancel
Save