Example #1
0
        public void IsValid_ShouldBeFalse_WhenRequiredFieldsAreNotSet()
        {
            var command = new CreateEmailLogCommand();

            var validator = new CreateEmailLogCommandValidator(Context);

            var result = validator.Validate(command);

            result.IsValid.ShouldBe(false);
        }
Example #2
0
        public void IsValid_ShouldBeTrue_WhenRequiredFieldsAreSet()
        {
            var command = new CreateEmailLogCommand
            {
                EmailId  = 1,
                SentDate = DateTime.Now,
                SentBy   = "UnitTest"
            };

            var validator = new CreateEmailLogCommandValidator(Context);

            var result = validator.Validate(command);

            result.IsValid.ShouldBe(true);
        }