public void AccountRepository_Save()
        {
            var accountDataAccessMock = new AccountDataAccessMock();
            var account = new Account
            {
                Name = "Sparkonto",
                CurrentBalanceWithoutExchange = 6034,
                CurrentBalance = 6034,
                Currency = "CHF"
            };

             accountDataAccessMock.Save(account);

            Assert.IsTrue(account == accountDataAccessMock.AccountTestList[0]);
        }
        public void AccountRepository_SaveWithoutName()
        {
            var accountDataAccessMock = new AccountDataAccessMock();
            var repository = new AccountRepository(accountDataAccessMock);

            var account = new Account
            {
                CurrentBalanceWithoutExchange = 6034,
                CurrentBalance = 6034,
                Currency = "CHF"
            };

            repository.Save(account);

            Assert.AreSame(account, accountDataAccessMock.AccountTestList[0]);
            Assert.IsTrue(accountDataAccessMock.AccountTestList[0].Name == Strings.NoNamePlaceholderLabel);
        }
        public void AccountRepository_Delete()
        {
            var accountDataAccessMock = new AccountDataAccessMock();
            var repository = new AccountRepository(accountDataAccessMock);

            var account = new Account
            {
                Name = "Sparkonto",
                CurrentBalanceWithoutExchange = 6034,
                CurrentBalance = 6034,
                Currency = "CHF"
            };

            repository.Save(account);

            Assert.IsTrue(account == accountDataAccessMock.AccountTestList[0]);

            repository.Delete(account);

            Assert.IsFalse(accountDataAccessMock.AccountTestList.Any());
            Assert.IsFalse(repository.Data.Any());
        }
Exemplo n.º 4
0
 public void Init()
 {
     _accountDataAccessMock = new AccountDataAccessMock();
 }