Пример #1
0
        public void TestGetBalance()
        {
            var cacheLogic = new CacheLogic();

            cacheLogic.ClearCache();

            var registerLogic = new RegistrationLogic();

            registerLogic.RegisterNewUser("alex", "pass");

            WithdrawlLogic withdrawlLogic = new WithdrawlLogic();

            withdrawlLogic.CreateWithdrawl("Customer1", "Check", 22, "alex");

            withdrawlLogic.CreateWithdrawl("Customer1", "Check", 2, "alex");

            DepositLogic depositLogic = new DepositLogic();

            depositLogic.CreateDeposit("Customer1", "Check", 55, "alex");

            TransactionLogic transactionLogic = new TransactionLogic();

            var currentBalance = transactionLogic.GetBalance("alex");

            Assert.AreEqual((55 - 22 - 2), currentBalance);
        }