public void DeleteBankAccountSuccessfully()
        {
            var repo = new BankAccountRepository();
            var userId = "ec9bf096-c505-4bef-87f6-18822b9dbf2c"; //some user created before
            var account = new BankAccount
            {
                UserId = userId,
                Active = true,
                Bank = new Bank
                {
                    BankName = "Test bank, inc",
                    AccountName = "Test account",
                    AccountNumber = "8123456789",
                    AccountType = "savings",
                    Country = "AUS",
                    HolderType = "personal",
                    RoutingNumber = "123456"
                }
            };
            var createdAccount = repo.CreateBankAccount(account);
            Assert.IsTrue(createdAccount.Active);
            var result = repo.DeleteBankAccount(createdAccount.Id);

            Assert.IsTrue(result);

            var gotAccount = repo.GetBankAccountById(createdAccount.Id);
            Assert.IsFalse(gotAccount.Active);
        }
예제 #2
0
        public void GetBankAccountSuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/bank_account_get_by_id.json");

            var client = GetMockClient(content);
            var repo = new BankAccountRepository(client.Object);
            const string id = "ec9bf096-c505-4bef-87f6-18822b9dbf2c";
            var gotAccount = repo.GetBankAccountById(id);
            client.VerifyAll();
            Assert.AreEqual(id, gotAccount.Id);
        }
예제 #3
0
 public void GetBankAccountEmptyId()
 {
     var client = GetMockClient("");
     var repo = new BankAccountRepository(client.Object);
     repo.GetBankAccountById(string.Empty);
 }
 public void GetBankAccountEmptyId()
 {
     var repo = new BankAccountRepository();
     repo.GetBankAccountById(string.Empty);
 }