public void SetUp()
 {
     validRequest = CreateValidCustomers();
 }
Exemple #2
0
 public object Delete(ValidCustomers request)
 {
     return(new ValidCustomersResponse {
         Result = request
     });
 }
        private static List <ResponseError> GetValidationFieldErrors(string httpMethod, ValidCustomers request)
        {
            var validator = (IValidator) new CustomersValidator
            {
                AddressValidator = new AddressValidator()
            };

            var validationResult = validator.Validate(
                new ValidationContext(request, null, new MultiRuleSetValidatorSelector(httpMethod)));

            var responseStatus = validationResult.ToErrorResult().ToResponseStatus();

            var errorFields = responseStatus.Errors;

            return(errorFields ?? new List <ResponseError>());
        }