예제 #1
0
        public void GetBankAccounts_ShouldReturnBankAccounts()
        {
            var context = serviceProvider.GetRequiredService <DataContext>();

            var controller = new BankAccountsController(context);

            context.BankAccount.Add(bankAccount1);
            context.BankAccount.Add(bankAccount2);

            var bankAccounts = controller.GetBankAccounts().Value.ToList();

            Assert.Equal(bankAccount1, bankAccounts[0]);
            Assert.Equal(bankAccount2, bankAccounts[1]);
        }