public void CanDebitCashAccountMultipleTimes()
        {
            var testContext = new AccountTestContext();

            testContext.Create(Workspace, AccountService);
            testContext.MakeSale(100);
            testContext.MakeSale(200);
            var balance     = AccountService.GetAccountBalance(testContext.CashAccount.Id);
            var saleBalance = AccountService.GetAccountBalance(testContext.SaleAccount.Id);

            Assert.AreEqual(0, balance + saleBalance);
        }
        public void CanCalculateUsdCashAccountMultipleTimes()
        {
            var testContext = new AccountTestContext();

            testContext.Create(Workspace, AccountService);
            testContext.MakeUsdSale(100);
            var usdBalance = AccountDao.GetAccountExchangeBalance(testContext.UsdCashAccount.Id);

            Assert.AreEqual(100, usdBalance);
            var saleBalance = AccountDao.GetAccountExchangeBalance(testContext.SaleAccount.Id);

            Assert.AreEqual(-200, saleBalance);
        }
        public void CanCalculateCashAccountMultipleTimes()
        {
            var testContext = new AccountTestContext();

            testContext.Create(Workspace, AccountService);
            testContext.MakeSale(100);
            testContext.MakeRefund(50);
            testContext.MakeSale(100);
            testContext.MakeRefund(10);
            testContext.MakeRefund(40);
            var balance = AccountService.GetAccountBalance(testContext.CashAccount.Id);

            Assert.AreEqual(100, balance);
        }