今天看见测试的某些代码 不知道什么意思
[Test]和[ExpectedException(typeof(BalanceNonEnoughException))]
之后
public void TestTransferFunds2()
{
Account tmpA = new Account();
Account tmpB = new Account();
tmpA.Balance = 200F;
tmpB.Balance = 40F;
try{
tmpA.TransferFunds(tmpB, 250F);}
catch(Exception ex)
{ throw ex; } Assert.AreEqual(200F, tmpA.Balance);
Assert.AreEqual(40F, tmpB.Balance);
}
需要引用那些命名空间 每句话又是做什么用的?
请教测试的朋友
[Test]和[ExpectedException(typeof(BalanceNonEnoughException))]
之后
public void TestTransferFunds2()
{
Account tmpA = new Account();
Account tmpB = new Account();
tmpA.Balance = 200F;
tmpB.Balance = 40F;
try{
tmpA.TransferFunds(tmpB, 250F);}
catch(Exception ex)
{ throw ex; } Assert.AreEqual(200F, tmpA.Balance);
Assert.AreEqual(40F, tmpB.Balance);
}
需要引用那些命名空间 每句话又是做什么用的?
请教测试的朋友
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货