1[Test]
2public void TransferWithInsufficientFundsAtomicity()
3{
4 Account source = new Account();
5 source.Deposit(200.00F);
6 Account destination = new Account();
7 destination.Deposit(150.00F);
8 try
9 {
10 source.TransferFunds(destination, 300.00F);
11 }
12 catch(InsufficientFundsException expected)
13 {
14 }
15 Assert.AreEqual(200.00F,source.Balance);
16 Assert.AreEqual(150.00F,destination.Balance);
17}
nunit使用指南之(6)
内容版权声明:除非注明,否则皆为本站原创文章。