Skip to content

Commit

Permalink
Remove argument validation from internal HtmlAttribute .ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Aug 12, 2023
1 parent fd91a0a commit 8abcd53
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
6 changes: 0 additions & 6 deletions HtmlKit/HtmlAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ public HtmlAttribute (string name, string value)

internal HtmlAttribute (string name)
{
if (name is null)
throw new ArgumentNullException (nameof (name));

if (name.Length == 0)
throw new ArgumentException ("The attribute name cannot be empty.", nameof (name));

Name = name;
}

Expand Down
3 changes: 0 additions & 3 deletions UnitTests/HtmlAttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public void TestArgumentExceptions ()
Assert.Throws<ArgumentNullException> (() => new HtmlAttribute (null, string.Empty));
Assert.Throws<ArgumentException> (() => new HtmlAttribute (string.Empty, string.Empty));
Assert.Throws<ArgumentException> (() => new HtmlAttribute ("a b c", string.Empty));

Assert.Throws<ArgumentNullException> (() => new HtmlAttribute (null));
Assert.Throws<ArgumentException> (() => new HtmlAttribute (string.Empty));
}

[Test]
Expand Down

0 comments on commit 8abcd53

Please sign in to comment.