Skip to content

Commit

Permalink
Added more InternetAddress[List]Converter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Dec 22, 2024
1 parent e4f9ebc commit 69752cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// InternetAddressTypeConverterTests.cs
// InternetAddressConverterTests.cs
//
// Author: Jeffrey Stedfast <jestedfa@microsoft.com>
//
Expand Down Expand Up @@ -30,7 +30,7 @@

namespace UnitTests {
[TestFixture]
public class InternetAddressTypeConverterTests
public class InternetAddressConverterTests
{
[Test]
public void TestCanConvert ()
Expand Down Expand Up @@ -78,5 +78,12 @@ public void TestIsNotValid ()
Assert.That (converter.IsValid (""), Is.False);
Assert.That (converter.IsValid (5), Is.False);
}

[Test]
public void TestRegisterTwiceThrows ()
{
InternetAddressConverter.Register (ParserOptions.Default);
Assert.Throws<InvalidOperationException> (() => InternetAddressConverter.Register (ParserOptions.Default));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// InternetAddressListTypeConverterTests.cs
// InternetAddressListConverterTests.cs
//
// Author: Jeffrey Stedfast <jestedfa@microsoft.com>
//
Expand Down Expand Up @@ -31,7 +31,7 @@
namespace UnitTests
{
[TestFixture]
public class InternetAddressListTypeConverterTests
public class InternetAddressListConverterTests
{
[Test]
public void TestCanConvert ()
Expand Down Expand Up @@ -81,5 +81,12 @@ public void TestIsNotValid ()
Assert.That (converter.IsValid (""), Is.False);
Assert.That (converter.IsValid (5), Is.False);
}

[Test]
public void TestRegisterTwiceThrows ()
{
InternetAddressListConverter.Register (ParserOptions.Default);
Assert.Throws<InvalidOperationException> (() => InternetAddressListConverter.Register (ParserOptions.Default));
}
}
}

0 comments on commit 69752cd

Please sign in to comment.