Example #1
0
        public async Task GetCustomerAccountsAsync_ForNonExistingAccountId_ReturnsNullAsync()
        {
            var repo = new AccountsInMemRepository(_dataProvider.Object);

            var result = await repo.GetCustomerAccountsAsync(100);

            result.Should().BeNull();
        }
Example #2
0
        public void CreateAccountsAsync_ForExistingCustomerId_CreatesAccount()
        {
            var repo = new AccountsInMemRepository(_dataProvider.Object);

            Task <AccountViewModel> task = repo.CreateAccountAsync(3);
            var result = task.Result;

            result.Should().NotBeNull();
        }
Example #3
0
        public void GetCustomerAccountsAsync_ForExistingAccountId_ReturnsNonEmptyList()
        {
            var repo = new AccountsInMemRepository(_dataProvider.Object);

            Task <IEnumerable <AccountViewModel> > task = repo.GetCustomerAccountsAsync(1);
            var result = task.Result;

            result.Should().NotBeNullOrEmpty();
        }
Example #4
0
        public void GetCustomerAccountAsync_WithNoAccountData_ReturnsNull()
        {
            var dataProvider = new Mock <ITestDataProvider>();
            var repo         = new AccountsInMemRepository(dataProvider.Object);

            Task <IEnumerable <AccountViewModel> > task = repo.GetCustomerAccountsAsync(1);
            var result = task.Result;

            result.Should().BeNull();
        }
Example #5
0
        public void CreateAccountAsync_WithNoAccountData_ReturnsNewFirstAccount()
        {
            var dataProvider = new Mock <ITestDataProvider>();
            var repo         = new AccountsInMemRepository(dataProvider.Object);

            Task <AccountViewModel> task = repo.CreateAccountAsync(1);
            var result = task.Result;

            result.Should().NotBeNull();
            result.AccountId.Should().Be(1);
        }