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(); }
public void IsValid_ShouldBeFalse_WhenNameIsNull() { var command = new CreateTeamCommand { Name = null }; var validator = new CreateTeamCommandValidator(); var result = validator.Validate(command); result.IsValid.ShouldBe(false); }
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); }