I am learning about unit testing using the NUnit framework.
I built a monopoly game in a console application and am now conducting unit tests for each class.
I am struggling with writing a test for my game class that only takes 1 method:
public abstract class Game: GameInterface
{
private int playersCount;
public abstract void initializeGame();
public abstract void makePlay(int player);
public abstract bool endOfGame();
public abstract void printWinner();
// A template method :
public void playOneGame(int playersCount)
{
this.playersCount = playersCount;
initializeGame();
int j = 0;
while (!endOfGame())
{
makePlay(j);
j = (j + 1) % playersCount;
}
printWinner();
}
}
How could I write a test for this using the NUnit framework??
Thankyou