Пример #1
0
        public void IsValid_ShouldBeFalse_WhenRequiredFieldsAreNotSet()
        {
            var command = new CreateGuestCommand();

            var validator = new CreateGuestCommandValidator(Context);

            var result = validator.Validate(command);

            result.IsValid.ShouldBe(false);
        }
Пример #2
0
        public void IsValid_ShouldBeTrue_WhenRequiredFieldsAreSet()
        {
            var command = new CreateGuestCommand
            {
                FirstName = "Test FirstName",
                LastName  = "Test LastName",
                Email     = "Test Email"
            };

            var validator = new CreateGuestCommandValidator(Context);

            var result = validator.Validate(command);

            result.IsValid.ShouldBe(true);
        }