Beispiel #1
0
        public void CreateBankAccount()
        {
            var context = serviceProvider.GetRequiredService <DataContext>();

            var controller = new BankAccountsController(context);

            controller.PostBankAccount(bankAccount1);

            var createdBankAccount = controller.GetBankAccountById(bankAccount1.Id).Result.Value;

            Assert.Equal(createdBankAccount, bankAccount1);
        }
Beispiel #2
0
        public void GetByIdBankAccount_ShouldReturnBankAccountById()
        {
            var context = serviceProvider.GetRequiredService <DataContext>();

            var controller = new BankAccountsController(context);

            context.BankAccount.Add(bankAccount1);

            var bankAccount = controller.GetBankAccountById(bankAccount1.Id).Result.Value;

            Assert.Equal(bankAccount1, bankAccount);
        }
Beispiel #3
0
        public void DeleteBankAccount()
        {
            var context = serviceProvider.GetRequiredService <DataContext>();

            var controller = new BankAccountsController(context);

            context.BankAccount.Add(bankAccount1);

            context.SaveChanges();

            controller.DeleteBankAccount("18379133");

            var bankAccount = controller.GetBankAccountById("18379133").Result.Value;

            Assert.Null(bankAccount);
        }