コード例 #1
0
        public void Insert1ChangeDistinctTransactions()
        {
            var logic = new VendorMachine.Logic();

            logic.Input("1.00");
            var result = logic.Input("CHANGE");

            Assert.AreEqual("=1.00 1.00", result);
        }
コード例 #2
0
        public void JustChange()
        {
            var logic  = new VendorMachine.Logic();
            var result = logic.Input("CHANGE");

            Assert.AreEqual("=0.00 NO_CHANGE", result);
        }
コード例 #3
0
        public void RequestElevenCokes()
        {
            var logic  = new VendorMachine.Logic();
            var result = logic.Input("1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Coke Coke Coke Coke Coke Coke Coke Coke Coke Coke Coke");

            Assert.AreEqual("NO_PRODUCT =11.00", result);
        }
コード例 #4
0
        public void SampleTest4()
        {
            var logic  = new VendorMachine.Logic();
            var result = logic.Input("1.00 Pastelina Pastelina Pastelina");

            Assert.AreEqual("Pastelina =0.70 Pastelina =0.40 Pastelina =0.10", result);
        }
コード例 #5
0
        public void SampleTest3()
        {
            var logic  = new VendorMachine.Logic();
            var result = logic.Input("0.25 0.05 Pastelina CHANGE");

            Assert.AreEqual("Pastelina =0.00 NO_CHANGE", result);
        }
コード例 #6
0
        public void SampleTest1()
        {
            var logic  = new VendorMachine.Logic();
            var result = logic.Input("0.50 1.00 Coke");

            Assert.AreEqual("Coke =0.00", result);
        }
コード例 #7
0
        public void Request9Pastelinas()
        {
            var logic = new VendorMachine.Logic();

            logic.Input("0.50 Pastelina CHANGE");
            logic.Input("0.50 Pastelina CHANGE");
            logic.Input("0.50 Pastelina CHANGE");
            logic.Input("0.50 Pastelina CHANGE");
            logic.Input("0.50 Pastelina CHANGE");
            logic.Input("0.50 Pastelina CHANGE");
            logic.Input("0.50 Pastelina CHANGE");
            logic.Input("0.50 Pastelina CHANGE");
            var result = logic.Input("0.50 Pastelina CHANGE");

            Assert.AreEqual("NO_COINS =0.50", result);
        }