📜  nunit 期望异常 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:20.542000             🧑  作者: Mango

代码示例1
[Test]
public void TransferWithInsufficientFunds()
{
    Account source = new Account();
    source.Deposit(200m);

    Account destination = new Account();
    destination.Deposit(150m);

    Assert.That(() => source.TransferFunds(destination, 300m), 
                Throws.TypeOf());
}