Пример #1
0
        public void GetUserForBankAccountSuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/bank_account_get_users.json");

            var client = GetMockClient(content);
            var repo = new BankAccountRepository(client.Object);
            const string userId = "ec9bf096-c505-4bef-87f6-18822b9dbf2c"; //some user created before
            var gotUser = repo.GetUserForBankAccount("ec9bf096-c505-4bef-87f6-18822b9dbf2c");
            client.VerifyAll();
            Assert.IsNotNull(gotUser);

            Assert.AreEqual(userId, gotUser.Id);
        }
        public void GetUserForBankAccountSuccessfully()
        {
            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);

            var gotUser = repo.GetUserForBankAccount(createdAccount.Id);

            Assert.IsNotNull(gotUser);

            Assert.AreEqual(userId, gotUser.Id);
        }