コード例 #1
0
        public void GivenValidate_WhenHavingAnOutOfRangeStars_ThenResultShouldBeInvalid()
        {
            var model     = CreateRatingModelFactory.WithStarsOutOfRange();
            var validator = new CreateRatingModelValidator();

            var result = validator.Validate(model);

            result.IsValid.Should().BeFalse();
            result.Errors.Count.Should().Be(1);
        }
コード例 #2
0
        public void GivenValidate_WhenHavingAValidInput_ThenResultShouldBeValid()
        {
            var model     = CreateRatingModelFactory.Default();
            var validator = new CreateRatingModelValidator();

            var result = validator.Validate(model);

            result.IsValid.Should().BeTrue();
            result.Errors.Count.Should().Be(0);
        }