public void ShouldReturnSuccessResultWhenValidatorResultIsPresentWithEmptyMessage() { GivenValidatorOneResults.Add(new KeyValuePair <string, string>("FieldOne", "")); GivenValidatorTwoResults.Add(new KeyValuePair <string, string>("FieldTwo", "")); WhenValidatingRequest(); ThenIsValid.Should().BeTrue(); ThenValidationResult.Success.Should().BeTrue(); ThenValidationResult.ValidationMessagesByFieldId.Should().Contain("FieldOne", ""); ThenValidationResult.ValidationMessagesByFieldId.Should().Contain("FieldTwo", ""); }
public void ShouldCombineValidatorResultsUsingTheFirstMessageAddedPerFieldId() { GivenValidatorOneResults.Add(new KeyValuePair <string, string>("FieldOne", "FieldOne Message 1")); GivenValidatorOneResults.Add(new KeyValuePair <string, string>("FieldOne", "FieldOne Message 2")); GivenValidatorTwoResults.Add(new KeyValuePair <string, string>("FieldTwo", "FieldTwo Message 1")); GivenValidatorTwoResults.Add(new KeyValuePair <string, string>("FieldTwo", "FieldTwo Message 2")); WhenValidatingRequest(); ThenIsValid.Should().BeFalse(); ThenValidationResult.Success.Should().BeFalse(); ThenValidationResult.ValidationMessagesByFieldId.Should().Contain("FieldOne", "FieldOne Message 1"); ThenValidationResult.ValidationMessagesByFieldId.Should().Contain("FieldTwo", "FieldTwo Message 1"); }