public void EnoughFundsRuleNo() { Portfolio p = new Portfolio(); p.Cash = 1; Trade t = new Trade(); t.type = tradeTypes.Buy; t.quantity = 2; t.price = 10.25; EnoughFundsRule r = new EnoughFundsRule(); Assert.Throws<InsufficientFunds>(() => r.Apply(p, t)); }
public void EnoughFundsRuleYes() { Portfolio p = new Portfolio(); p.Cash = 5000; Trade t = new Trade(); t.type = tradeTypes.Buy; t.quantity = 2; t.price = 10.25; EnoughFundsRule r = new EnoughFundsRule(); Assert.IsTrue(r.Apply(p, t)); }