public void GetServicesValidator_is_valid_if_gencontext_is_initialized(GetServicesValidator validator, GetServicesCommand command) { InitFakeGenContext(); validator .ShouldNotHaveValidationErrorFor(x => GenContext.ToolBox, command); }
public void GetServicesValidator_failed_if_gencontext_is_not_initialized(GetServicesValidator validator, GetServicesCommand command) { ClearFakeGenContext(); validator .ShouldHaveValidationErrorFor(x => GenContext.ToolBox, command) .WithErrorMessage(StringRes.BadReqNotSynced); }
public void GetServicesValidator_failed_if_project_type_is_null_or_empty(GetServicesValidator validator) { var command = _fixture .Build <GetServicesCommand>() .With(x => x.ProjectType, string.Empty) .Create(); validator .ShouldHaveValidationErrorFor(t => t.ProjectType, command) .WithErrorMessage(StringRes.BadReqInvalidProjectType); }
public void GetServicesValidator_is_valid_if_contain_frontend_or_backend_framework(GetServicesValidator validator) { var command_without_frontend_framework = _fixture .Build <GetServicesCommand>() .With(x => x.FrontendFramework, string.Empty) .Create(); var command_without_backend_framework = _fixture .Build <GetServicesCommand>() .With(x => x.BackendFramework, string.Empty) .Create(); validator .ShouldNotHaveValidationErrorFor(t => t.FrontendFramework, command_without_frontend_framework); validator .ShouldNotHaveValidationErrorFor(t => t.BackendFramework, command_without_backend_framework); }
public void GetServicesValidator_failed_if_frontend_and_backend_frameworks_are_null_or_empty(GetServicesValidator validator) { var command = _fixture .Build <GetServicesCommand>() .With(x => x.FrontendFramework, string.Empty) .With(x => x.BackendFramework, string.Empty) .Create(); validator .TestValidate(command) .ShouldHaveAnyValidationError() .WithErrorMessage(StringRes.BadReqNoBackendOrFrontend); }