}
}
}
現在讓我們為此類編寫第一個測試-AccountTest。我們即將測試的第一個方法是TransferFunds。
namespace bank
{
using NUnit.Framework;
[TestFixture]
public class AccountTest
{
[Test]
public void TransferFunds()
{
Account source = new Account();
source.Deposit(200.00F);
Account destination = new Account();
destination.Deposit(150.00F);
source.TransferFunds(destination, 100.00F);
Assert.AreEqual(250.00F, destination.Balance);
Assert.AreEqual(100.00F, source.Balance);
}
}
}
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/