Beispiel #1
0
 public void CanDebitCashAccount()
 {
     var testContext = new AccountTestContext();
     testContext.Create(Workspace, AccountService);
     testContext.MakeSale(100);
     Workspace.CommitChanges();
     var balance = AccountService.GetAccountBalance(testContext.CashAccount.Id);
     Assert.AreEqual(100, balance);
 }
Beispiel #2
0
 public void CanCreditCashAccountMultipleTimes()
 {
     var testContext = new AccountTestContext();
     testContext.Create(Workspace, AccountService);
     testContext.MakeSale(100);
     testContext.MakeSale(200);
     testContext.MakeRefund(50);
     var balance = AccountService.GetAccountBalance(testContext.CashAccount.Id);
     Assert.AreEqual(250, balance);
 }
        public void CanDebitCashAccount()
        {
            var testContext = new AccountTestContext();

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

            Assert.AreEqual(100, balance);
        }
        public void CanCreditCashAccountMultipleTimes()
        {
            var testContext = new AccountTestContext();

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

            Assert.AreEqual(250, balance);
        }
        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);
        }
Beispiel #6
0
 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);
 }