コード例 #1
0
        public void NameNewStockReturnsCorrectNameForSecondAddedEquity()
        {
            var sut = new StockNameProvider();

            sut.CreateNewStockName(new Equity(1.0m, 1));
            var equity = new Equity(1.5m, 2);
            var name   = sut.CreateNewStockName(equity);

            Assert.AreEqual("Equity2", name);
        }
コード例 #2
0
        public void NameNewStockReturnsCorrectNameForThirdAddedEquityAfterABondHasBeenAddedAswell()
        {
            var sut = new StockNameProvider();

            sut.CreateNewStockName(new Equity(1.0m, 2));
            sut.CreateNewStockName(new Equity(9.0m, 2));
            sut.CreateNewStockName(new Bond(2.0m, 1));
            var equity = new Equity(5.0m, 2);
            var name   = sut.CreateNewStockName(equity);

            Assert.AreEqual("Equity3", name);
        }
コード例 #3
0
        public void NameNewStockReturnsCorrectNameForFirstAddedEquity()
        {
            var sut    = new StockNameProvider();
            var equity = new Equity(1.0m, 5);
            var name   = sut.CreateNewStockName(equity);

            Assert.AreEqual("Equity1", name);
        }
コード例 #4
0
        public void NameNewStockReturnsCorrectNameForFirstAddedBond()
        {
            var sut  = new StockNameProvider();
            var bond = new Bond(1.0m, 2);
            var name = sut.CreateNewStockName(bond);

            Assert.AreEqual("Bond1", name);
        }
コード例 #5
0
        public void NameNewStockThrowsOnNullStock()
        {
            var sut = new StockNameProvider();

            Assert.Throws <ArgumentNullException>(() => sut.CreateNewStockName(null));
        }