summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs b/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs
index 2b012dd..53df6c8 100644
--- a/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs
@@ -19,6 +19,22 @@ namespace DotNetOpenAuth.Test.OpenId {
private string xri = "=arnott*andrew";
[TestMethod]
+ public void TryParseNoThrow() {
+ Identifier id;
+ Assert.IsFalse(Identifier.TryParse(null, out id));
+ Assert.IsFalse(Identifier.TryParse("", out id));
+ }
+
+ [TestMethod]
+ public void TryParse() {
+ Identifier id;
+ Assert.IsTrue(Identifier.TryParse("http://host/path", out id));
+ Assert.AreEqual("http://host/path", id.ToString());
+ Assert.IsTrue(Identifier.TryParse("=arnott", out id));
+ Assert.AreEqual("=arnott", id.ToString());
+ }
+
+ [TestMethod]
public void Parse() {
Assert.IsInstanceOfType(Identifier.Parse(this.uri), typeof(UriIdentifier));
Assert.IsInstanceOfType(Identifier.Parse(this.xri), typeof(XriIdentifier));