public void GetCustomerAccounts_KnownUserAccountsAccessed_ReturnsNotNull() { //Arrange CustomerDL customerDL = new CustomerDL(); //Act var result = customerDL.GetCustomerAccount(10000000111); //Assert Assert.IsNotNull(result); }
private void searchAccount_Click(object sender, EventArgs e) { searchBox.Text = searchBox.Text.Trim(); if (searchBox.Text.Any(ch => !(Char.IsDigit(ch)))) { MessageBox.Show("Invalid Arguments!!!"); } else { var customerAccounts = customerDL.GetCustomerAccount(Int64.Parse(searchBox.Text)); if (customerAccounts.Count() == 0) { MessageBox.Show("No Active Customer Accounts Found !!!"); } else { this.searchAccount.Enabled = false; this.searchBox.Enabled = false; this.mainPanel.Visible = true; foreach (var item in customerAccounts) { if (item.AccountType == 1) { this.selectAccount.Items.Add("Chequing"); } else if (item.AccountType == 2) { this.selectAccount.Items.Add("Saving"); } else if (item.AccountType == 3) { this.selectAccount.Items.Add("Liability"); } } this.selectAccount.SelectedIndex = 0; } } }
private void searchButton_Click(object sender, EventArgs e) { customerIdSearch.Text = customerIdSearch.Text.Trim(); if (customerIdSearch.Text.Any(ch => !char.IsDigit(ch))) { MessageBox.Show("Invalid Arguments!!!"); } else { var customerReturned = customerDL.GetCustomerDetail(Int64.Parse(customerIdSearch.Text)); if (customerReturned == null) { MessageBox.Show("No user Found !!!"); } else { this.MainPanel.Visible = true; accountIdGenerated.Text = accountDL.GetNewAccountId().ToString(); var customerAccounts = customerDL.GetCustomerAccount(Int64.Parse(customerIdSearch.Text)); if (customerAccounts.Count() == 3) { MessageBox.Show("You Cannot Open More Accounts"); this.Close(); } else { this.branchIDcomboBox.SelectedIndex = customerReturned.customerBranchId - 1; this.searchButton.Enabled = false; this.customerIdSearch.Enabled = false; foreach (var item in customerAccounts) { if (item.AccountType == 1) { this.accountTypeComboBox.Items.Remove("Chequing Account"); } if (item.AccountType == 2) { this.accountTypeComboBox.Items.Remove("Saving Account"); } if (item.AccountType == 3) { this.accountTypeComboBox.Items.Remove("Liability Account"); } } this.accountTypeComboBox.SelectedIndex = 0; } } } }