Beispiel #1
0
        public void Should_Fail_By_PageSize_LessThan0()
        {
            // arrange
            var command = ListMembershipCommandFake.InvalidByPageSize().Generate();
            var sut     = new ListMembershipValidator();

            // act
            var result = sut.Validate(command);

            // assert
            result.AssertErrorsCount(1);
        }
Beispiel #2
0
        public void Should_Succeed()
        {
            // arrange
            var command = ListMembershipCommandFake.Valid().Generate();
            var sut     = new ListMembershipValidator
            {
                CascadeMode = FluentValidation.CascadeMode.Stop
            };

            // act
            var result = sut.Validate(command);

            // assert
            result.Should().NotBeNull()
            .And.BeOfType <ValidationResult>();
            result.IsValid.Should().BeTrue();
        }