예제 #1
0
        public void ShouldContainNoErrors()
        {
            // Arrange
            var name        = "name";
            var image       = "image";
            var description = "description";
            var layout      = Guid.NewGuid().ToString();

            var command = new CreateTeamCommand(name, image, description, layout);

            // Act
            var validationResult = _validator.Validate(command);
            var exists           = validationResult.Errors.Count > 0;

            // Assert
            exists.Should().BeFalse();
        }
예제 #2
0
        public void IsValid_ShouldBeFalse_WhenNameIsNull()
        {
            var command = new CreateTeamCommand
            {
                Name = null
            };

            var validator = new CreateTeamCommandValidator();

            var result = validator.Validate(command);

            result.IsValid.ShouldBe(false);
        }
예제 #3
0
        public void IsValid_ShouldBeTrue_WhenNameIsNotNull()
        {
            var command = new CreateTeamCommand
            {
                Name = "Not Null < 200 byte"
            };

            var validator = new CreateTeamCommandValidator();

            var result = validator.Validate(command);

            result.IsValid.ShouldBe(true);
        }