Jithu
0
Q:

nunit expect exception

[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<InsufficientFundsException>());
}
1

New to Communities?

Join the community