Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Theory]
- [MemberData("StringValidatorValidateEmailAddressShouldPopulateErrorCollection")]
- public void StringValidator_ValidateEmailAddress_ShouldPopulateErrorCollection(
- int order,
- string emailAddress,
- List<string> errorCollection,
- bool shouldThroException,
- int expectedAmountOfErrorsInErrorCollection)
- {
- // Given
- // When
- Action action = () => this.stringValidator.ValidateEmailAddress(emailAddress, errorCollection);
- // Then
- if (shouldThroException)
- {
- action.ShouldThrowExactly<InvalidEmailAddressDigitalLibraryValidationException>();
- }
- else
- {
- action.ShouldNotThrow();
- }
- errorCollection.Count.Should().Be(expectedAmountOfErrorsInErrorCollection);
- }
- public static IEnumerable<object[]> StringValidatorValidateEmailAddressShouldPopulateErrorCollection
- {
- get
- {
- return new List<object[]>
- {
- new object[] { 3, "asd@c", new List<string>(), false, 1 },
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement