Beispiel #1
0
        public void PhoneValidationTest()
        {
            ValidationWebService services = new ValidationWebService();
            string validNumber            = "+4588888888";
            string invalidNumber          = "+45588888888";

            bool valid   = services.ValidPhoneNumber(validNumber);
            bool invalid = services.ValidPhoneNumber(invalidNumber);

            Assert.IsTrue(valid);
            Assert.IsFalse(invalid);
        }
        public async void UpdateEmployee(Employees employee)
        {
            ErrorMessage = "Saving...";

            employee.EmploymentTime = EmploymentTimes;
            employee.Notes          = validation.ApplyLanguageFilter(employee.Notes);
            bool validPhoneNumber = validation.ValidPhoneNumber(employee.HomePhone);

            if (!validPhoneNumber)
            {
                ErrorMessage = "Invalid phone number";
            }
            else
            {
                await webService.SaveEmployee(employee);

                mainViewModel.SelectedViewModel = new HRViewModel(mainViewModel);
            }
        }