summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdTextBoxTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdTextBoxTests.cs')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdTextBoxTests.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdTextBoxTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdTextBoxTests.cs
new file mode 100644
index 0000000..67255e3
--- /dev/null
+++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdTextBoxTests.cs
@@ -0,0 +1,49 @@
+//-----------------------------------------------------------------------
+// <copyright file="OpenIdTextBoxTests.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
+ using DotNetOpenAuth.OpenId.RelyingParty;
+ using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+ [TestClass]
+ public class OpenIdTextBoxTests : OpenIdTestBase {
+ /// <summary>
+ /// Verifies that the Text and Identifier properties interact correctly.
+ /// </summary>
+ [TestMethod]
+ public void IdentifierTextInteraction() {
+ var box = new OpenIdTextBox();
+ Assert.AreEqual(string.Empty, box.Text);
+ Assert.IsNull(box.Identifier);
+
+ box.Text = "=arnott";
+ Assert.AreEqual("=arnott", box.Text);
+ Assert.AreEqual("=arnott", box.Identifier.ToString());
+
+ box.Identifier = "=bob";
+ Assert.AreEqual("=bob", box.Text);
+ Assert.AreEqual("=bob", box.Identifier.ToString());
+
+ box.Text = string.Empty;
+ Assert.AreEqual(string.Empty, box.Text);
+ Assert.IsNull(box.Identifier);
+
+ box.Text = null;
+ Assert.AreEqual(string.Empty, box.Text);
+ Assert.IsNull(box.Identifier);
+
+ // Invalid identifier case
+ box.Text = "/";
+ Assert.AreEqual("/", box.Text);
+ Assert.IsNull(box.Identifier);
+
+ // blank out the invalid case
+ box.Identifier = null;
+ Assert.AreEqual(string.Empty, box.Text);
+ Assert.IsNull(box.Identifier);
+ }
+ }
+}