public void BankerControllerTest() { var banker = new BankerController(); Assert.IsNotNull(banker); }
public void Setup() { CustomerRepo = new Mock <ICustomerRepo>(); AccountRepo = new Mock <IAccountRepo>(); BankerRepo = new Mock <IBankerRepo>(); BankController = new BankerController( CustomerRepo.Object, AccountRepo.Object, BankerRepo.Object ); var controllerBuilder = new TestControllerBuilder(); controllerBuilder.InitializeController(BankController); var accounts1 = new List <Account> { new Account { BIC = "BIC-1", IBAN = "IBAN-1", ID = 1, Owner_ID = 1, Solde = 2000 }, new Account { BIC = "BIC-1", IBAN = "IBAN-2", ID = 2, Owner_ID = 1, Solde = 0 } }; var accounts2 = new List <Account> { new Account { BIC = "BIC-1", IBAN = "IBAN-3", ID = 3, Owner_ID = 2, Solde = 2000 }, new Account { BIC = "BIC-1", IBAN = "IBAN-4", ID = 4, Owner_ID = 2, Solde = 0 } }; customers = new List <Customer> { new Customer { FirstName = "fn-1", LastName = "ln-1", AccountNumber = "1111", ID = 1, Banker_ID = 1, Accounts = accounts1, Password = "******" }, new Customer { FirstName = "fn-2", LastName = "ln-2", AccountNumber = "2222", ID = 1, Banker_ID = 2, Accounts = accounts2, Password = "******" }, }; bankers = new List <Banker> { new Banker() { FirstName = "fn-1", LastName = "ln-1", ID = 1, Mail = "*****@*****.**", Customers = customers, Password = "******" }, }; accounts = new List <Account>(); accounts.AddRange(accounts1); accounts.AddRange(accounts2); transactions = new List <Transaction> { new AccountToAcountTransaction { Account = accounts1[0], Amount = 5000, Date = DateTime.Now, TransactionType = TransactionType.CREDIT, Title = "virement - hacene kedjar" }, new AccountToAcountTransaction { Account = accounts2[0], Amount = 1260, Date = DateTime.Now, TransactionType = TransactionType.DEBIT, Title = "virement" } }; BankController.Session[Utils.SessionBanker] = bankers[0]; }