Beispiel #1
0
        public void PurchaseMade_CoinsInserted_FirstDisplayThankYouThenInsertCoins()
        {
            var sut = new DisplayModule();

            sut.UpdateInsertedCoinValue(.50m);
            sut.PurchaseMade();
            sut.UpdateInsertedCoinValue(0m);

            Assert.AreEqual("THANK YOU", sut.ReadOut);
            Assert.AreEqual("INSERT COINS", sut.ReadOut);
        }
Beispiel #2
0
        public void DefaultState_CoinsInserted_DisplayTotalValue()
        {
            var sut = new DisplayModule();

            sut.UpdateInsertedCoinValue(0.15m);
            sut.DefaultState();

            Assert.AreEqual("$0.15", sut.ReadOut);
        }
Beispiel #3
0
        public void ProductSoldOut_CoinsInserted_ReadOfDisplay_FirstDisplayProductPriceThenInsertCoins()
        {
            var sut = new DisplayModule();

            sut.UpdateInsertedCoinValue(.50m);
            sut.ProductNotAvailable();

            Assert.AreEqual("SOLD OUT", sut.ReadOut);
            Assert.AreEqual("$0.50", sut.ReadOut);
        }
Beispiel #4
0
        public void PurchaseMadeInsufficientFunds_CoinsInserted_FirstDisplayProductPriceThenInsertCoins()
        {
            var sut = new DisplayModule();

            sut.UpdateInsertedCoinValue(.05m);
            sut.InsufficientFundsForProduct(.25m);

            Assert.AreEqual("PRICE: $0.25", sut.ReadOut);
            Assert.AreEqual("$0.05", sut.ReadOut);
        }