Skip to content

Commit

Permalink
Merge pull request #30 from CHG-MERIDIAN/FixInvalidSecurityInfoException
Browse files Browse the repository at this point in the history
Don't validate information set by text
  • Loading branch information
twenzel authored Jan 10, 2019
2 parents bf0d101 + 639cd4a commit 1f02563
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
commit-message-incrementing: Disabled
ignore:
sha:
- 717e38f8897218bd5cee0446bc4c70423b3b56eb
- 51dcc960438b33b43af3dce00f17f0e94ad66925
- c0d27c0204080830655fb211ca367a378cf54cf8
6 changes: 5 additions & 1 deletion src/Internal/SecurityTextContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ public string Build()
/// Validates the values.
/// </summary>
public void Validate()
{
{
// Don't validate information set by text
if (!string.IsNullOrEmpty(Text))
return;

if (!string.IsNullOrEmpty(Contact))
ValidateContact();
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ public void Throws_No_Exception_For_HTTPS_Contact()
action.Should().NotThrow();
}

[Test]
public void Throws_No_Exception_For_Missing_Contact_When_Set_By_Text()
{
_container.Contact = null;
_container.Text = "Contact: mailto:[email protected]\r\n";
Action action = () => _container.Validate();
action.Should().NotThrow();
}

[Test]
public void Throws_No_Exception_If_Contact_Is_Valid_Email_Address()
{
Expand Down

0 comments on commit 1f02563

Please sign in to comment.