public OrdersUserControlViewModel() { ValidationWebService validationWebService = new ValidationWebService(); ExchangeRates = validationWebService.GetRates().ToList(); orders = new ObservableCollection <Order>(); invoices = new ObservableCollection <Invoice>(); Task.Factory.StartNew(() => GetOrders()); selectedRate = ExchangeRates.FirstOrDefault(e => e.Currency == "USD"); }
public void LanguageFilterTest() { ValidationWebService services = new ValidationWebService(); string text = "F**k you"; string expected = "**** you"; string result = services.ApplyLanguageFilter(text); Assert.AreEqual(expected, result); }
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); }
/// <summary> /// Checks if the notes is valid /// </summary> /// <param name="employee">The employee to check</param> /// <returns>A bool which indicates if its valid and a list of errors</returns> public (bool isValid, List <string> errors) ValidateNotes(Employee employee) { ValidationWebService validationWebService = new ValidationWebService(); return(validationWebService.ValidateNotes(employee.Notes)); }
/// <summary> /// Checks if the phone number is valid /// </summary> /// <param name="employee">The employee to check</param> /// <returns>A bool that indicates if the phone number is valid</returns> public bool IsPhoneNumberValid(Employee employee) { ValidationWebService validationWebService = new ValidationWebService(); return(validationWebService.ValidatePhoneNumber(employee)); }
public void ExceptionTest(string url) { ValidationWebService validationWebService = new ValidationWebService(); Assert.Throws <AggregateException>(() => validationWebService.GetRates(url)); }