Вот мой код:
Код: Выделить всё
[TestFixture]
public class Tests
{
CardTable aTable = null;
[SetUp]
public void setup()
{
aTable = new CardTable();
}
[Test]
public void setPlayerGold_setTo0_return0()
{
//arrange
//act
aTable.setPlayerGold(0);
//assert
Assert.AreEqual(0, aTable.playerGold);
}
}
public class CardTable
{
int playerGold;
public CardTable()
{
playerGold = 0;
}
public void setPlayerGold(int amount)
{
if (amount == 0)
{
playerGold = 0;
}
else
{
playerGold += amount;
}
goldLabel.Text = playerGold + "";
}
Я использую Visual C# 2010 Express v10.0.40219.1 SP1Rel с NUnit 2.6.0.12051.
Будем благодарны за любую помощь.
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/104 ... sing-nunit
Мобильная версия