public void WhenAllPropertiesValid_ThenSucceeds() { var dto = new CreateClientApplication { Name = "avalue", }; validator.ValidateAndThrow(dto); }
/// <summary> /// Provides the Create request for the 'ClientApplications' resource. /// </summary> public CreateClientApplicationResponse Post(CreateClientApplication body) { return(ProcessRequest(body, HttpStatusCode.Created, () => { var response = this.ClientApplicationsManager.CreateClientApplication(this.Request, body); this.SetLocationHeader(GetCreateClientApplicationResponseId(response)); return response; })); }
public void WhenNameIsNull_ThenThrows() { var dto = new CreateClientApplication { Name = null, }; Assert.Throws <ValidationException>( FluentValidation <CreateClientApplication> .NotNullErrorMessage(x => x.Name), () => validator.ValidateAndThrow(dto)); }
CreateClientApplicationResponse IClientApplicationsManager.CreateClientApplication(IRequest request, CreateClientApplication body) { return(new CreateClientApplicationResponse { ClientApplication = (ClientApplication)CreateClientApplication(body.Name), }); }