使用NUnit进行单元测试,使用NUnit进,用NUnit进行,NUnit进行单,Unit进行单元,nit进行单元测

本站地址:http://www.bajiao123.com

使用NUnit进行单元测试
; balance=value; [TestFixture(Description="帐号测试")]
public class AccountTest
{
[Test(Description="转帐测试")]
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);//should be 250
Assert.AreEqual(100.00F, source.Balance);
Console.WriteLine("Funds Tranfer Event Tested Successfully");
}
[Test(Description="Account.Balance的Get属性")]
public void GetTest()
{
Account source=new Account();
source.Deposit(100.00F);
 
本站地址:http://www.bajiao123.com

