Example #1
0
        public void GivenUpsertRecipeModel_WhenHavingTypeEmpty_ThenResultShouldBeInvalid()
        {
            var model     = UpsertRecipeModelFactory.WithTypeEmpty();
            var validator = new UpsertRecipeModelValidator();

            var result = validator.Validate(model);

            result.IsValid.Should().BeFalse();
        }
Example #2
0
        public void GivenUpsertRecipeModel_WhenHavingDescriptionWithMoreThan300Characters_ThenResultShouldBeInvalid()
        {
            var model     = UpsertRecipeModelFactory.WithDescriptionGreaterThan300Characters();
            var validator = new UpsertRecipeModelValidator();

            var result = validator.Validate(model);

            result.IsValid.Should().BeFalse();
        }
Example #3
0
        public void GivenUpsertRecipeModel_WhenHavingValidType_ThenResultShouldBeValid()
        {
            var model     = UpsertRecipeModelFactory.Default();
            var validator = new UpsertRecipeModelValidator();

            var result = validator.Validate(model);

            result.IsValid.Should().BeTrue();
        }
Example #4
0
        public void GivenUpsertRecipeModel_WhenHavingANullIngredientsList_ThenResultShouldBeInvalid()
        {
            var model     = UpsertRecipeModelFactory.WithIngredientsListNull();
            var validator = new UpsertRecipeModelValidator();

            var result = validator.Validate(model);

            result.IsValid.Should().BeFalse();
        }