コード例 #1
0
        public string Balance_CorrectPin_ReturnBalance(int balance)
        {
            var atm = new Atm(int.MaxValue);

            atm.BeginSession(1111, 1111, balance, 1);

            var result = atm.GetBalance();

            return(result);
        }
コード例 #2
0
        public void Balance_IncorrectPin_ReturnAccountError()
        {
            var atm = new Atm(int.MaxValue);

            atm.BeginSession(1111, 0, 1, 1);

            var result = atm.GetBalance();

            Assert.AreEqual(result, "ACCOUNT_ERR");
        }
コード例 #3
0
        public void Withdraw_InsufficientBalance_BalanceUnchanged()
        {
            var atm = new Atm(int.MaxValue);

            atm.BeginSession(1111, 1111, 1, 0);

            atm.WithdrawCash(1000);

            Assert.AreEqual(atm.GetBalance(), "1");
        }
コード例 #4
0
        public void Withdraw_SufficientBalance_BalanceUpdated()
        {
            var atm = new Atm(int.MaxValue);

            atm.BeginSession(0, 0, 1, 0);
            atm.WithdrawCash(1);

            var result = atm.GetBalance();

            Assert.AreEqual(result, "0");
        }