public void TryTake_Missing() { var storage = new FundStorage(Money.Dollar(123)); Assert.False(storage.TryTake(Money.Dollar(125))); Assert.Equal(Money.Dollar(123), storage.Funds); }
public void TryTake_Exact() { var storage = new FundStorage(Money.Dollar(123)); Assert.True(storage.TryTake(Money.Dollar(123))); Assert.Equal(Money.Dollar(0), storage.Funds); }
public void TryTake_Available() { var storage = new FundStorage(Money.Dollar(123)); Assert.True(storage.TryTake(Money.Dollar(10))); Assert.Equal(Money.Dollar(113), storage.Funds); }
public void TryTake_Negative() { var storage = new FundStorage(Money.Dollar(123)); Assert.Throws <ArgumentException>(() => storage.TryTake(Money.Dollar(-20))); }