public void GetTestingsValidator_is_valid_if_gencontext_is_initialized(GetTestingsValidator validator, GetTestingsCommand command)
        {
            InitFakeGenContext();

            validator
            .ShouldNotHaveValidationErrorFor(x => GenContext.ToolBox, command);
        }
        public void GetTestingsValidator_failed_if_gencontext_is_not_initialized(GetTestingsValidator validator, GetTestingsCommand command)
        {
            ClearFakeGenContext();

            validator
            .ShouldHaveValidationErrorFor(x => GenContext.ToolBox, command)
            .WithErrorMessage(StringRes.BadReqNotSynced);
        }
        public void GetTestingsValidator_failed_if_project_type_is_null_or_empty(GetTestingsValidator validator)
        {
            var command = _fixture
                          .Build <GetTestingsCommand>()
                          .With(x => x.ProjectType, string.Empty)
                          .Create();

            validator
            .ShouldHaveValidationErrorFor(t => t.ProjectType, command)
            .WithErrorMessage(StringRes.BadReqInvalidProjectType);
        }
        public void GetTestingsValidator_is_valid_if_contain_frontend_or_backend_framework(GetTestingsValidator validator)
        {
            var command_without_frontend_framework = _fixture
                                                     .Build <GetTestingsCommand>()
                                                     .With(x => x.FrontendFramework, string.Empty)
                                                     .Create();

            var command_without_backend_framework = _fixture
                                                    .Build <GetTestingsCommand>()
                                                    .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 GetTestingsValidator_failed_if_frontend_and_backend_frameworks_are_null_or_empty(GetTestingsValidator validator)
        {
            var command = _fixture
                          .Build <GetTestingsCommand>()
                          .With(x => x.FrontendFramework, string.Empty)
                          .With(x => x.BackendFramework, string.Empty)
                          .Create();

            validator
            .TestValidate(command)
            .ShouldHaveAnyValidationError()
            .WithErrorMessage(StringRes.BadReqNoBackendOrFrontend);
        }