Пример #1
0
        public void ShouldContainNoErrors()
        {
            // Arrange
            var id          = Guid.NewGuid();
            var name        = "name";
            var image       = "image";
            var description = "description";
            var layout      = "layout";
            var driverWait  = "No";
            var operators   = new List <Guid>()
            {
                Guid.NewGuid()
            };
            var filterContent = "{site:123456}";
            var version       = 1;

            var command = new UpdateTeamCommand(id,
                                                name,
                                                image,
                                                description,
                                                driverWait,
                                                layout,
                                                operators,
                                                filterContent,
                                                version);

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

            // Assert
            exists.Should().BeFalse();
        }
        public void IsValid_ShouldBeFalse_WhenNameIsNull()
        {
            var command = new UpdateTeamCommand
            {
                Id   = validId.ToString(),
                Name = null
            };

            var validator = new UpdateTeamCommandValidator();

            var result = validator.Validate(command);

            result.IsValid.ShouldBe(false);
        }
        public void IsValid_ShouldBeTrue_WhenNameIsNotNull()
        {
            var command = new UpdateTeamCommand
            {
                Id   = validId.ToString(),
                Name = "Not Null < 200 byte"
            };

            var validator = new UpdateTeamCommandValidator();

            var result = validator.Validate(command);

            result.IsValid.ShouldBe(true);
        }