Exemple #1
0
        public void ImperfectNickelDiameterAndWeightRecognized()
        {
            IVendingMachine machine = GetVendingMachineInstance();
            ICoin           coin    = new InputCoin(21.25f, 5.05f);

            machine.Messages.Dequeue();

            machine.InsertCoin(coin);

            Assert.AreEqual("$0.05", machine.Messages.Dequeue());
        }
Exemple #2
0
        public void InvalidCoin()
        {
            IVendingMachine machine = GetVendingMachineInstance();
            ICoin           coin    = new InputCoin(42.42f, 0.42f);

            machine.Messages.Dequeue();

            machine.InsertCoin(coin);

            Assert.AreEqual("EXACT CHANGE ONLY", machine.Messages.Dequeue());
            Assert.AreEqual(1, machine.CoinReturn.Count);
            Assert.AreEqual(coin, machine.CoinReturn[0]);
        }