Skip to content

Commit 6944aa8

Browse files
committed
Added a failed test for incorrect parsing of commas
1 parent 414ffae commit 6944aa8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Diff for: test/Program.cs

+17
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,23 @@ public void email_addresses_cannot_have_domain_ending_with_hyphen()
6868
Assert.IsFalse(result.Any(), "No results should be returned");
6969
}
7070

71+
[TestMethod]
72+
public void comma_should_terminate_address()
73+
{
74+
// Arrange
75+
const string input = "email1@example.com,email2@example.com";
76+
const string expectedFirst = "email1@example.com";
77+
const string expectedLast = "email2@example.com";
78+
79+
// Act
80+
var result = this.ExtractAddresses(input);
81+
82+
// Assert
83+
Assert.IsTrue(result.Count == 2, "Two results should be returned");
84+
Assert.AreEqual(expectedFirst, result.First(), $"First email address must be {expectedFirst}");
85+
Assert.AreEqual(expectedLast, result.Last(), $"Last email address must be {expectedLast}");
86+
}
87+
7188
#region Wrappers
7289

7390
/// <summary>

0 commit comments

Comments
 (0)