public void Lock_Account_Locks_The_Given_Account()
        {
            /*
             *   Arrange
             * 1º - Create a fake data
             * 2º - Initialize stub of IBankingManagementService
             * 3º - Create controller to test
             */

            string      accountNumber = "EX325";
            BankAccount account       = new BankAccount()
            {
                BankAccountNumber = accountNumber, Locked = false
            };


            SIBankingManagementService bankingService = new SIBankingManagementService();

            bankingService.FindBankAccountByNumberString = accNumber => account;
            bankingService.ChangeBankAccountBankAccount  = bankAccount => { };

            BankAccountController controller = new BankAccountController(bankingService);


            //Act
            RedirectToRouteResult result = controller.LockAccount(accountNumber) as RedirectToRouteResult;

            //Assert
            Assert.IsNotNull(result, "Expected a RedirectToRouteResult");
            Assert.AreEqual("TransferMoney", result.RouteValues["action"], "Expected a redirection to TransferMoney");
        }
Exemplo n.º 2
0
        public async Task BankAccountList_Null()
        {
            //Arrange

            var _efCoreMock = new Mock <IRepository>();

            _efCoreMock.Setup(x => x.GetAll <BankAccount>());
            var userStore = new Mock <IUserStore <Customer> >();

            var _customerManagerMock = new Mock <UserManager <Customer> >(
                userStore.Object, null, null, null, null, null, null, null, null);

            var _mapperMock    = new Mock <IMapper>();
            var bankController = new BankAccountController(_efCoreMock.Object,
                                                           _customerManagerMock.Object,
                                                           _mapperMock.Object);
            // //Act

            var response = await bankController.GetAccounts();

            var okResult = response as OkObjectResult;

            // // Assert
            Assert.NotNull(okResult);
            Assert.Equal(200, okResult.StatusCode);
        }
Exemplo n.º 3
0
        public void PerfTest2()
        {
            var mediator           = new Mock <IMediator>();
            var account_controller = new BankAccountController(mediator.Object);

            account_controller.createBankAccount(new System.Guid("99999999-9999-9999-9999-999999999999"));
            List <Thread> list = new List <Thread>();

            for (int i = 0; i < 100000; i++)
            {
                account_controller.createBankAccount(new System.Guid(i.ToString().PadLeft(8, '0') + "-9999-9999-9999-999999999999"));
                list.Append(new Thread(() =>
                {
                    Thread.CurrentThread.IsBackground = true;
                    var money_controller           = new MoneyTransferController(mediator.Object);
                    var money_transfer             = new BankAccountService.Common.Models.MoneyTransferModel();
                    money_transfer.Amount          = 100.0f;
                    money_transfer.TargetAccountId = new System.Guid("99999999-9999-9999-9999-999999999999");
                    var result     = money_controller.makeTransfer(new System.Guid(i.ToString().PadLeft(8, '0') + "-9999-9999-9999-999999999999"), money_transfer);
                    var obj_result = result.Result as ObjectResult;
                    Assert.IsNotNull(obj_result);
                    Assert.AreEqual(200, obj_result.StatusCode);
                }));
            }

            foreach (Thread t in list)
            {
                t.Start();
            }
        }
Exemplo n.º 4
0
        public void AddOwnerToBankAccount_Existing_Owner_Expect_ArgumentException_Test()
        {
            //IRepository<IBankAccount, int> repository = new BankAccountRepository();
            BankAccountController mgr = new BankAccountController(repository);

            ICustomer customer1 = new Customer(1, "Name", "Address", "Phone", "Email");

            IBankAccount account1 = mgr.CreateNewBankAccount(customer1);

            Assert.AreEqual(1, account1.Owners.Count);
            Assert.AreSame(customer1, account1.Owners[0]);

            Assert.AreEqual(1, customer1.BankAccounts.Count);
            Assert.AreSame(account1, customer1.BankAccounts[0]);

            try
            {
                mgr.AddOwnerToBankAccount(account1, customer1);
            }
            catch (ArgumentException)
            {
                Assert.AreEqual(1, account1.Owners.Count);
                Assert.AreSame(customer1, account1.Owners[0]);

                Assert.AreEqual(1, customer1.BankAccounts.Count);
                Assert.AreSame(account1, customer1.BankAccounts[0]);
            }
        }
        public async Task CreateEditDeleteAsync()
        {
            var userStoreMock = new Mock <IUserStore <ApplicationUser> >();

            // Arrange
            var bankAccountController = new BankAccountController(new UserManager <ApplicationUser>(userStoreMock.Object,
                                                                                                    null, null, null, null, null, null, null, null));
            var transactionController = new TransactionController(new UserManager <ApplicationUser>(userStoreMock.Object,
                                                                                                    null, null, null, null, null, null, null, null));

            var bankAccount = new BankAccount();
            var result      = await bankAccountController.Create(bankAccount);

            // Assert
            Assert.IsType <RedirectToActionResult>(result);


            // Arrange
            var bankAccountId = bankAccount.Id;

            // Act
            var transactionViewModel = new TransactionViewModel
            {
                BankAccountId = bankAccountId,
                Amount        = "100",
                IsDeposition  = true
            };

            result = await transactionController.Create(transactionViewModel);

            // Assert
            Assert.IsType <RedirectToActionResult>(result);

            var transactionId = transactionViewModel.Id;

            // Act
            result = await transactionController.Details(transactionId);

            // Assert
            Assert.IsType <ViewResult>(result);

            // Act

            result = await transactionController.Edit(transactionId);

            // Assert
            Assert.IsType <ViewResult>(result);

            // Act
            result = await transactionController.Edit(transactionId, transactionViewModel);

            // Assert
            Assert.IsType <RedirectToActionResult>(result);

            // Act
            result = await bankAccountController.DeleteConfirmed(bankAccountId);

            // Assert
            Assert.IsType <RedirectToActionResult>(result);
        }
 public void Setup()
 {
     consolWrapper         = Substitute.For <IConsolWrapper>();
     calendarWrapper       = Substitute.For <ICalendar>();
     bankAccount           = Substitute.For <IBankAccount>();
     bankAccountController = new BankAccountController(consolWrapper, calendarWrapper, bankAccount);
 }
 /// <summary>
 /// this function will retrive the bank name from the glossary tables based upon the given bank account
 /// </summary>
 /// <param name="bankAccountController">the bank account controller</param>
 public void GetBankOfAccount(BankAccountController bankAccountController)
 {
     bankAccountController.Bank = base.InstitutiiBancare
                                  .Where(element =>
                                         element.CodIban == Miscellaneous.BankFunctions.GetCodeFromIBAN(bankAccountController.Account))
                                  .FirstOrDefault().Denumire;
 }
Exemplo n.º 8
0
        public async Task AddBankAccount_Test()
        {
            var bankModel = new CreateBankAccountModel {
                AccountType    = 1,
                InitialDeposit = 20.00m
            };

            var _efCoreMock = new Mock <IRepository>();

            _efCoreMock.Setup(x => x.Add <BankAccount>(It.IsAny <BankAccount>()));
            var userStore = new Mock <IUserStore <Customer> >();

            var _customerManagerMock = new Mock <UserManager <Customer> >(
                userStore.Object, null, null, null, null, null, null, null, null);

            var _mapperMock    = new Mock <IMapper>();
            var bankController = new BankAccountController(_efCoreMock.Object,
                                                           _customerManagerMock.Object,
                                                           _mapperMock.Object);
            //_efCoreMock.SetupGet(x => x.HttpContext.User.Identity.Name);
            var response = await bankController.CreateAccount(bankModel);

            var ok = response as OkObjectResult;

            Assert.Equal(201, ok.StatusCode);
        }
        public void Transfer_Money_Shows_A_List_Of_Bank_Accounts()
        {
            /*
             *   Arrange
             * 1º - Create a dummy list of transfers
             * 2º - Initialize stub of IBankingManagementService
             * 3º - Create controller to test
             */

            IList <BankAccount> accounts = GetFakeBankAccounts();

            SIBankingManagementService bankingService = new SIBankingManagementService();

            bankingService.FindPagedBankAccountsInt32Int32 = (page, pageSize) => accounts.Skip(page * pageSize).Take(pageSize).ToList();

            BankAccountController controller = new BankAccountController(bankingService);

            //Act
            ViewResultBase result = controller.TransferMoney() as ViewResult;

            //Assert
            Assert.IsNotNull(result);

            BankAccountListViewModel model = result.ViewData.Model as BankAccountListViewModel;

            Assert.IsNotNull(model);
        }
        public void Transfer_Money_Performs_The_Transfer_Of_The_Given_Amount_Between_The_Given_Accounts()
        {
            /*
             *   Arrange
             * 1º - Create a fake data
             * 2º - Initialize stub of IBankingManagementService
             * 3º - Create controller to test
             */
            decimal transferAmount = 50;
            string  sourceAccount  = "eX325";
            string  targetAccount  = "eX287";



            SIBankingManagementService bankingService = new SIBankingManagementService();

            bankingService.PerformTransferStringStringDecimal = (source, target, amount) => { };

            BankAccountController controller = new BankAccountController(bankingService);

            //Act
            RedirectToRouteResult result = controller.TransferMoney(sourceAccount, targetAccount, transferAmount) as RedirectToRouteResult;

            //Assert
            Assert.IsNotNull(result, "Expected a RedirectToRouteResult");

            Assert.AreEqual("TransferMoney", result.RouteValues["action"], "Expected a redirection to TransferMoney");
        }
Exemplo n.º 11
0
        public async void Patch_No_Errors()
        {
            BankAccountControllerMockFacade mock = new BankAccountControllerMockFacade();
            var mockResult = new Mock <UpdateResponse <ApiBankAccountServerResponseModel> >();

            mockResult.SetupGet(x => x.Success).Returns(true);
            mock.ServiceMock.Setup(x => x.Update(It.IsAny <int>(), It.IsAny <ApiBankAccountServerRequestModel>()))
            .Callback <int, ApiBankAccountServerRequestModel>(
                (id, model) => model.AccountNumber.Should().Be("A")
                )
            .Returns(Task.FromResult <UpdateResponse <ApiBankAccountServerResponseModel> >(mockResult.Object));
            mock.ServiceMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <ApiBankAccountServerResponseModel>(new ApiBankAccountServerResponseModel()));
            BankAccountController controller = new BankAccountController(mock.ApiSettingsMoc.Object, mock.LoggerMock.Object, mock.TransactionCoordinatorMock.Object, mock.ServiceMock.Object, new ApiBankAccountServerModelMapper());

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = new DefaultHttpContext();

            var patch = new JsonPatchDocument <ApiBankAccountServerRequestModel>();

            patch.Replace(x => x.AccountNumber, "A");

            IActionResult response = await controller.Patch(default(int), patch);

            response.Should().BeOfType <OkObjectResult>();
            (response as OkObjectResult).StatusCode.Should().Be((int)HttpStatusCode.OK);
            mock.ServiceMock.Verify(x => x.Update(It.IsAny <int>(), It.IsAny <ApiBankAccountServerRequestModel>()));
        }
Exemplo n.º 12
0
        public async void BulkInsert_No_Errors()
        {
            BankAccountControllerMockFacade mock = new BankAccountControllerMockFacade();

            var mockResponse = ValidationResponseFactory <ApiBankAccountServerResponseModel> .CreateResponse(null as ApiBankAccountServerResponseModel);

            mockResponse.SetRecord(new ApiBankAccountServerResponseModel());
            mock.ServiceMock.Setup(x => x.Create(It.IsAny <ApiBankAccountServerRequestModel>())).Returns(Task.FromResult <CreateResponse <ApiBankAccountServerResponseModel> >(mockResponse));
            BankAccountController controller = new BankAccountController(mock.ApiSettingsMoc.Object, mock.LoggerMock.Object, mock.TransactionCoordinatorMock.Object, mock.ServiceMock.Object, mock.ModelMapperMock.Object);

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = new DefaultHttpContext();

            var records = new List <ApiBankAccountServerRequestModel>();

            records.Add(new ApiBankAccountServerRequestModel());
            IActionResult response = await controller.BulkInsert(records);

            response.Should().BeOfType <OkObjectResult>();
            (response as OkObjectResult).StatusCode.Should().Be((int)HttpStatusCode.OK);
            var result = (response as OkObjectResult).Value as CreateResponse <List <ApiBankAccountServerResponseModel> >;

            result.Success.Should().BeTrue();
            result.Record.Should().NotBeEmpty();
            mock.ServiceMock.Verify(x => x.Create(It.IsAny <ApiBankAccountServerRequestModel>()));
        }
        public void RemoveCustomer_Existing_Customer_With_NonEmpty_BankAccount_Test()
        {
            IRepository <ICustomer, int> repository = new CustomerRepository();
            ICustomerController          mgr        = new CustomerController(repository);

            ICustomer             customer1 = mgr.CreateNewCustomer("Name", "Address", "Phone", "Email");
            BankAccountController accMgr    = new BankAccountController(new BankAccountRepository());

            accMgr.CreateNewBankAccount(customer1, 123.45);

            Assert.AreEqual(1, mgr.GetAllCustomers().Count);
            Assert.AreSame(customer1, mgr.GetAllCustomers()[0]);
            Assert.AreEqual(1, customer1.BankAccounts.Count);
            Assert.AreEqual(123.45, customer1.BankAccounts[0].Balance);

            try
            {
                mgr.RemoveCustomer(customer1);
            }
            catch (ArgumentException)
            {
                Assert.AreEqual(1, mgr.GetAllCustomers().Count);
                Assert.AreSame(customer1, mgr.GetAllCustomers()[0]);
            }
        }
Exemplo n.º 14
0
        public void Deposite()
        {
            var         bankAccountController = new BankAccountController();
            MoneyUpdate amount            = new MoneyUpdate("PLN", 1000m);
            var         bankAccountHeader = bankAccountController.Deposite(Guid.Parse("4939209E-8CAA-4722-AC0D-31A1B15462DD"), amount);

            Assert.AreEqual(bankAccountHeader.Balances.First().Amount, 2000m);
            Assert.AreEqual(bankAccountHeader.Balances.First().CurrencyISOCode, "PLN");
        }
Exemplo n.º 15
0
        public void Withdraw()
        {
            var         bankAccountController = new BankAccountController();
            MoneyParams amount            = new MoneyParams("PLN", 1000m);
            var         bankAccountHeader = bankAccountController.Withdraw(Guid.Parse("4939209E-8CAA-4722-AC0D-31A1B15462DD"), amount);

            Assert.AreEqual(bankAccountHeader.Balances.First().Amount, 0m);
            Assert.AreEqual(bankAccountHeader.Balances.First().CurrencyISOCode, "PLN");
        }
Exemplo n.º 16
0
        public void Check_Status_And_Balance()
        {
            var bankAccountController = new BankAccountController();
            var bankAccountHeader     = bankAccountController.GetBankAccountHeader(Guid.Parse("4939209E-8CAA-4722-AC0D-31A1B15462DD"));

            Assert.AreEqual(bankAccountHeader.Status, "VerifiedState");
            Assert.AreEqual(bankAccountHeader.Balances.First().Amount, 1000m);
            Assert.AreEqual(bankAccountHeader.Balances.First().CurrencyISOCode, "PLN");
        }
Exemplo n.º 17
0
        public void CreateBankAccountTest()
        {
            var mediator           = new Mock <IMediator>();
            var account_controller = new BankAccountController(mediator.Object);
            var result             = account_controller.createBankAccount(new System.Guid("99999999-9999-9999-9999-999999999999"));
            var obj_result         = result as ObjectResult;

            Assert.IsNotNull(obj_result);
            Assert.AreEqual(200, obj_result.StatusCode);
        }
Exemplo n.º 18
0
        public void DeleteAccount_ShouldReturnCreatedAccount()
        {
            var accounts   = GetAllTestAccounts();
            var controller = new BankAccountController(accounts);

            var  result    = controller.DeleteAccount("321467");
            Type ts        = result.Result.GetType();
            var  resultObj = ts.GetProperty("Content").GetValue(result.Result);

            Assert.AreEqual(1, resultObj);
        }
Exemplo n.º 19
0
        /// <summary>
        /// this function will retrive the bank name from the glossary tables based upon the given bank account
        /// </summary>
        /// <param name="bankAccountController">the bank account controller</param>
        public static void GetBankOfAccount(BankAccountController bankAccountController)
        {
            String          queryCommand    = "SELECT denumire FROM glossary.institutii_bancare WHERE cod_iban = :p_iban ";
            NpgsqlParameter queryParameters = new NpgsqlParameter("p_iban", MentorBilling.Miscellaneous.BankFunctions.GetCodeFromIBAN(bankAccountController.Account));

            if (!PgSqlConnection.OpenConnection())
            {
                return;
            }
            bankAccountController.Bank = PgSqlConnection.ExecuteScalar(queryCommand, queryParameters).ToString();
            Miscellaneous.NormalConnectionClose(PgSqlConnection);
        }
Exemplo n.º 20
0
        public void Test1()
        {
            // In-memory database only exists while the connection is open
            var connection = new SqliteConnection("DataSource=:memory:");

            connection.Open();
            try
            {
                var options = new DbContextOptionsBuilder <WebWalletApiContext>()
                              .UseSqlite(connection)
                              .Options;

                // Create the schema in the database
                using (var context = new WebWalletApiContext(options))
                {
                    context.Database.EnsureCreated();
                }
                using (var context = new WebWalletApiContext(options))
                {
                    var bankId        = Guid.NewGuid();
                    var transactionId = Guid.NewGuid();
                    var bankAccount   = new BankAccount()
                    {
                        Id = bankId, Comment = "Kapitalkonto", Balance = "100", CreationTime = "", InterestRate = "", OwnerId = Guid.NewGuid(), Transactions = new List <Transaction>()
                    };
                    var transaction = new Transaction {
                        Id = transactionId, BankAccountId = bankId, Comment = "Insättning", Deposit = "100", CreationTime = "", Withdraw = ""
                    };
                    context.BankAccount.Add(bankAccount);
                    context.Transaction.Add(transaction);
                    context.SaveChanges();
                }

                using (var context = new WebWalletApiContext(options))
                {
                    var bc     = new BankAccountController(context);
                    var result = bc.GetBankAccounts();
                    Assert.NotNull(result);
                    Assert.Equal(result.Count(), 1);
                }
                using (var context = new WebWalletApiContext(options))
                {
                    var tc     = new TransactionController(context);
                    var result = tc.Get();
                    Assert.NotNull(result);
                    Assert.Equal(result.Count(), 1);
                }
            }
            finally
            {
                connection.Close();
            }
        }
Exemplo n.º 21
0
        public void CreateAccount_ShouldReturnCreatedAccount()
        {
            var accounts   = GetAllTestAccounts();
            var controller = new BankAccountController(accounts);

            BankAccount newAccount = new BankAccount("123456789", "890123", 999m);

            var  result    = controller.CreateAccount("123456789", "890123", 999m);
            Type ts        = result.Result.GetType();
            var  resultObj = ts.GetProperty("Content").GetValue(result.Result);

            Assert.AreEqual(newAccount, resultObj);
        }
Exemplo n.º 22
0
        public void GetById_Non_Existing_Account_Expect_Null_Test()
        {
            //IRepository<IBankAccount, int> repository = new BankAccountRepository();
            BankAccountController mgr = new BankAccountController(repository);

            ICustomer customer1 = new Customer(1, "Name", "Address", "Phone", "Email");

            IBankAccount account1 = mgr.CreateNewBankAccount(customer1);

            IBankAccount result = mgr.GetBankAccountById(2);

            Assert.IsNull(result);
        }
Exemplo n.º 23
0
        public void GetAllData_EmptyList()
        {
            //Arrange
            var Mockservice = new Mock <IApiRequestSend <BankAcount> >();

            BankAccountController BAC = new BankAccountController(Mockservice.Object);

            //Act
            var theReturn = BAC.GetAllData();

            Assert.Empty(theReturn);
            Mockservice.Verify(m => m.GetAllData(), Times.Once);
        }
Exemplo n.º 24
0
        public void GetAllAccounts_ShouldReturnAllAccounts()
        {
            var accounts   = GetAllTestAccounts();
            var controller = new BankAccountController(accounts);

            var result   = controller.GetAllAccounts();
            int countRec = 0;

            foreach (var tmp in result.Result)
            {
                countRec++;
            }
            Assert.AreEqual(accounts.Count, countRec);
        }
        public async Task IndexAsync()
        {
            var userStoreMock = new Mock <IUserStore <ApplicationUser> >();

            // Arrange
            var bankAccountController = new BankAccountController(new UserManager <ApplicationUser>(userStoreMock.Object,
                                                                                                    null, null, null, null, null, null, null, null));

            // Act
            var result = await bankAccountController.Index();

            // Assert
            Assert.IsType <ViewResult>(result);
        }
        public void CreateBankAccount()
        {
            var userStoreMock = new Mock <IUserStore <ApplicationUser> >();

            // Arrange
            var bankAccountController = new BankAccountController(new UserManager <ApplicationUser>(userStoreMock.Object,
                                                                                                    null, null, null, null, null, null, null, null));

            // Act
            var result = bankAccountController.Create() as ViewResult;

            // Assert
            Assert.IsType <ViewResult>(result);
        }
Exemplo n.º 27
0
        public void Deposit_ShouldReturnUpdatedAccount()
        {
            List <BankAccount> accounts = GetAllTestAccounts();
            var controller = new BankAccountController(accounts);

            var targetAccount = accounts.Find(r => r.AccountNumber == "123456");

            targetAccount.Deposit(50m); // = targetAccount.Balance + 50m;

            var  result    = controller.WithDraw("123456", 50m);
            Type ts        = result.Result.GetType();
            var  resultObj = ts.GetProperty("Content").GetValue(result.Result);

            Assert.AreEqual(targetAccount, resultObj);
        }
Exemplo n.º 28
0
        public void LoadCreatedBy(tbl_Account acc = null)
        {
            if (acc != null)
            {
                ddlCreatedBy.Items.Clear();
                ddlCreatedBy.Items.Insert(0, new ListItem(acc.Username, acc.Username));
            }
            else
            {
                var CreateBy = AccountController.GetAllNotSearch().Where(x => x.RoleID == 0 || x.RoleID == 2).ToList();
                ddlCreatedBy.Items.Clear();
                ddlCreatedBy.Items.Insert(0, new ListItem("Nhân viên tạo đơn", ""));
                if (CreateBy.Count > 0)
                {
                    foreach (var p in CreateBy)
                    {
                        ListItem listitem = new ListItem(p.Username, p.Username);
                        ddlCreatedBy.Items.Add(listitem);
                    }
                    ddlCreatedBy.DataBind();
                }

                // Add Customer Bank drop down list
                var cusBanks = BankController.getDropDownList();
                cusBanks[0].Text = "Ngân hàng chuyển";
                ddlCustomerBank.Items.Clear();
                ddlCustomerBank.Items.AddRange(cusBanks.ToArray());
                ddlCustomerBank.DataBind();

                // Add Account Bank drop down list
                var accBanks = BankAccountController.getDropDownList();
                accBanks[0].Text = "Ngân hàng nhận";
                ddlBankReceive.Items.Clear();
                ddlBankReceive.Items.AddRange(accBanks.ToArray());
                ddlBankReceive.DataBind();

                ddlAccoutBank.Items.Clear();
                ddlAccoutBank.Items.AddRange(accBanks.ToArray());
                ddlAccoutBank.DataBind();

                // Add Order status
                ddlStatus.Items.Clear();
                ddlStatus.Items.Add(new ListItem("Trạng thái giao dịch", "0"));
                ddlStatus.Items.Add(new ListItem("Đã nhận tiền", "1"));
                ddlStatus.Items.Add(new ListItem("Chưa nhận tiền", "2"));
                ddlStatus.SelectedIndex = 0;
            }
        }
Exemplo n.º 29
0
        public void AddValue_AddAccountToEmptyList()
        {
            //Arrange
            var Mockservice = new Mock <IApiRequestSend <BankAcount> >();

            BankAccountController BAC = new BankAccountController(Mockservice.Object);
            BankAcount            B   = new BankAcount {
                Personnummer = 940806
            };

            //Act
            BAC.AddAcount(B);

            Assert.Single(BAC.TheAcount);
            Mockservice.Verify(m => m.AddEntity(It.IsAny <BankAcount>()), Times.Once);
        }
Exemplo n.º 30
0
        public void GetById_Existing_Account_Test()
        {
            //IRepository<IBankAccount, int> repository = new BankAccountRepository();
            BankAccountController mgr = new BankAccountController(repository);

            ICustomer customer1 = new Customer(1, "Name", "Address", "Phone", "Email");
            ICustomer customer2 = new Customer(2, "Name", "Address", "Phone", "Email");

            IBankAccount account1 = mgr.CreateNewBankAccount(customer1);
            IBankAccount account2 = mgr.CreateNewBankAccount(customer2);

            IBankAccount result = mgr.GetBankAccountById(account2.AccountNumber);

            Assert.IsNotNull(result);
            Assert.AreSame(account2, result);
        }
Exemplo n.º 31
0
 public static BankAccountController Fixture()
 {
     BankAccountController controller = new BankAccountController(new BankAccountRepository(), "", new LoginView());
     return controller;
 }