Beispiel #1
0
        public void 投入金額と投入金額総計が一致するかテスト(int insertNum, int exp1, int exp2, int exp3, int exp4)
        {
            //投入するお金を用意
            this.SetMoneyNum(insertNum);

            var target = new MoneyController();

            //10円*1を投入
            target.InputMoneyAdd(this.yen10);
            var expect = exp1;
            var actual = target.InputMoneySum();

            Assert.AreEqual(expect, actual);

            //50円を投入
            target.InputMoneyAdd(this.yen50);
            expect = exp2;
            actual = target.InputMoneySum();
            Assert.AreEqual(expect, actual);

            //100円を投入
            target.InputMoneyAdd(this.yen100);
            expect = exp3;
            actual = target.InputMoneySum();
            Assert.AreEqual(expect, actual);

            //500円を投入
            target.InputMoneyAdd(this.yen500);
            expect = exp4;
            actual = target.InputMoneySum();
            Assert.AreEqual(expect, actual);
        }
Beispiel #2
0
        public void 投入金額と投入金額総計が一致するかテスト(int insertNum, int expect)
        {
            //投入するお金を用意
            this.SetMoneyNum(insertNum);

            var target = new MoneyController();

            //1円を投入
            target.InputMoneyAdd(this.yen1);

            //5円を投入
            target.InputMoneyAdd(this.yen5);

            //10円を投入
            target.InputMoneyAdd(this.yen10);

            //50円を投入
            target.InputMoneyAdd(this.yen50);

            //100円を投入
            target.InputMoneyAdd(this.yen100);

            //500円を投入
            target.InputMoneyAdd(this.yen500);

            //1000円を投入
            target.InputMoneyAdd(this.yen1000);

            //2000円を投入
            target.InputMoneyAdd(this.yen2000);

            //5000円を投入
            target.InputMoneyAdd(this.yen5000);

            //10000円を投入
            target.InputMoneyAdd(this.yen10000);


            //投入金額合計
            var actual = target.InputMoneySum();

            Assert.AreEqual(expect, actual);
        }
Beispiel #3
0
        public void 投入金額がそのまま払い戻し金額になるかテスト(int insertNum, int exp)
        {
            //投入するお金を用意
            this.SetMoneyNum(insertNum);

            var target = new MoneyController();

            //お金を投入
            target.InputMoneyAdd(this.yen10);
            target.InputMoneyAdd(this.yen50);
            target.InputMoneyAdd(this.yen100);
            target.InputMoneyAdd(this.yen500);


            var expect = exp;

            target.MoveInput2Refund();

            var actual = target.RefundMoneySum();

            Assert.AreEqual(expect, actual);
        }
Beispiel #4
0
        public void 取り扱い外の投入金がそのまま払い戻し金額になるかテスト(int insertNum)
        {
            //投入するお金を用意
            this.SetMoneyNum(insertNum);

            var target = new MoneyController();
            var expect = 0;


            //取り扱い外のお金を投入
            target.InputMoneyAdd(this.yen1);
            expect += this.yen1.Sum();

            target.InputMoneyAdd(this.yen5);
            expect += this.yen5.Sum();

            target.InputMoneyAdd(this.yen2000);
            expect += this.yen2000.Sum();

            target.InputMoneyAdd(this.yen5000);
            expect += this.yen5000.Sum();

            target.InputMoneyAdd(this.yen10000);
            expect += this.yen10000.Sum();


            //取り扱いOKのお金を投入
            target.InputMoneyAdd(this.yen10);
            target.InputMoneyAdd(this.yen50);
            target.InputMoneyAdd(this.yen100);
            target.InputMoneyAdd(this.yen500);
            target.InputMoneyAdd(this.yen1000);


            var actual = target.RefundMoneySum();

            Assert.AreEqual(expect, actual);
        }