Exemplo n.º 1
0
        private void AddAccountBtn_Click(object sender, EventArgs e)
        {
            Notification status;
            string       cellPhoneNumber = this.userAccountTxtBox.Text;

            cellPhoneNumber = systemParking.FormatPhoneNumber(cellPhoneNumber);
            status          = systemParking.ValidatePhoneNumber(cellPhoneNumber);
            status.AppendNotificationMessages(systemParking.ValidateExistingAccountForAddingAccount(cellPhoneNumber));
            if (!status.HasErrors())
            {
                status.AppendNotificationMessages(systemParking.AddAccount(cellPhoneNumber));
            }

            this.outputErrorLbl.Text      = status.HasErrors() ? $"Error: {status.Message()}" : status.Message();
            this.outputErrorLbl.ForeColor = status.HasErrors() ? Color.Red : Color.Green;
        }
Exemplo n.º 2
0
 public void AddAccountTest()
 {
     system.AddAccount("098960505");
     account = new Account("098960505");
     Assert.IsTrue(unitOfWork.Accounts.AccountAlreadyExists(account));
 }