Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }