diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId/DiscoveryServices')
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs | 36 | ||||
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs | 10 |
2 files changed, 23 insertions, 23 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs index f71d82f..7b12a1d 100644 --- a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs @@ -15,11 +15,11 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; using DotNetOpenAuth.OpenId.RelyingParty; - using Microsoft.VisualStudio.TestTools.UnitTesting; + using NUnit.Framework; - [TestClass] + [TestFixture] public class UriDiscoveryServiceTests : OpenIdTestBase { - [TestMethod] + [TestCase] public void DiscoveryWithRedirects() { Identifier claimedId = this.GetMockIdentifier(ProtocolVersion.V20, false); @@ -34,7 +34,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { Assert.AreEqual(1, this.Discover(userSuppliedIdentifier).Count()); } - [TestMethod] + [TestCase] public void DiscoverRequireSslWithSecureRedirects() { Identifier claimedId = this.GetMockIdentifier(ProtocolVersion.V20, true); @@ -49,7 +49,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { Assert.AreEqual(1, this.Discover(userSuppliedIdentifier).Count()); } - [TestMethod, ExpectedException(typeof(ProtocolException))] + [TestCase, ExpectedException(typeof(ProtocolException))] public void DiscoverRequireSslWithInsecureRedirect() { Identifier claimedId = this.GetMockIdentifier(ProtocolVersion.V20, true); @@ -65,7 +65,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { this.Discover(userSuppliedIdentifier); } - [TestMethod] + [TestCase] public void DiscoveryRequireSslWithInsecureXrdsInSecureHtmlHead() { var insecureXrdsSource = this.GetMockIdentifier(ProtocolVersion.V20, false); Uri secureClaimedUri = new Uri("https://localhost/secureId"); @@ -77,7 +77,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { Assert.AreEqual(0, this.Discover(userSuppliedIdentifier).Count()); } - [TestMethod] + [TestCase] public void DiscoveryRequireSslWithInsecureXrdsInSecureHttpHeader() { var insecureXrdsSource = this.GetMockIdentifier(ProtocolVersion.V20, false); @@ -91,7 +91,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { Assert.AreEqual(0, this.Discover(userSuppliedIdentifier).Count()); } - [TestMethod] + [TestCase] public void DiscoveryRequireSslWithInsecureXrdsButSecureLinkTags() { var insecureXrdsSource = this.GetMockIdentifier(ProtocolVersion.V20, false); string html = string.Format( @@ -110,10 +110,10 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { // We verify that the XRDS was ignored and the LINK tags were used // because the XRDS OP-LocalIdentifier uses different local identifiers. - Assert.AreEqual(OPLocalIdentifiersSsl[1], this.Discover(userSuppliedIdentifier).Single().ProviderLocalIdentifier); + Assert.AreEqual(OPLocalIdentifiersSsl[1].AbsoluteUri, this.Discover(userSuppliedIdentifier).Single().ProviderLocalIdentifier.ToString()); } - [TestMethod] + [TestCase] public void DiscoveryRequiresSslIgnoresInsecureEndpointsInXrds() { var insecureEndpoint = GetServiceEndpoint(0, ProtocolVersion.V20, 10, false); var secureEndpoint = GetServiceEndpoint(1, ProtocolVersion.V20, 20, true); @@ -122,7 +122,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { Assert.AreEqual(secureEndpoint.ProviderLocalIdentifier, this.Discover(secureClaimedId).Single().ProviderLocalIdentifier); } - [TestMethod] + [TestCase] public void XrdsDirectDiscovery_10() { this.FailDiscoverXrds("xrds-irrelevant"); this.DiscoverXrds("xrds10", ProtocolVersion.V10, null, "http://a/b"); @@ -130,14 +130,14 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { this.DiscoverXrds("xrds1020", ProtocolVersion.V10, null, "http://a/b"); } - [TestMethod] + [TestCase] public void XrdsDirectDiscovery_20() { this.DiscoverXrds("xrds20", ProtocolVersion.V20, null, "http://a/b"); this.DiscoverXrds("xrds2010a", ProtocolVersion.V20, null, "http://a/b"); this.DiscoverXrds("xrds2010b", ProtocolVersion.V20, null, "http://a/b"); } - [TestMethod] + [TestCase] public void HtmlDiscover_11() { this.DiscoverHtml("html10prov", ProtocolVersion.V11, null, "http://a/b"); this.DiscoverHtml("html10both", ProtocolVersion.V11, "http://c/d", "http://a/b"); @@ -151,7 +151,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { this.DiscoverHtml("html2010combinedC", ProtocolVersion.V11, "http://c/d", "http://a/b"); } - [TestMethod] + [TestCase] public void HtmlDiscover_20() { this.DiscoverHtml("html20prov", ProtocolVersion.V20, null, "http://a/b"); this.DiscoverHtml("html20both", ProtocolVersion.V20, "http://c/d", "http://a/b"); @@ -164,13 +164,13 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { this.FailDiscoverHtml("html20relative"); } - [TestMethod] + [TestCase] public void XrdsDiscoveryFromHead() { this.MockResponder.RegisterMockResponse(new Uri("http://localhost/xrds1020.xml"), "application/xrds+xml", LoadEmbeddedFile("/Discovery/xrdsdiscovery/xrds1020.xml")); this.DiscoverXrds("XrdsReferencedInHead.html", ProtocolVersion.V10, null, "http://a/b"); } - [TestMethod] + [TestCase] public void XrdsDiscoveryFromHttpHeader() { WebHeaderCollection headers = new WebHeaderCollection(); headers.Add("X-XRDS-Location", new Uri("http://localhost/xrds1020.xml").AbsoluteUri); @@ -181,7 +181,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { /// <summary> /// Verifies that a dual identifier yields only one service endpoint by default. /// </summary> - [TestMethod] + [TestCase] public void DualIdentifierOffByDefault() { this.MockResponder.RegisterMockResponse(VanityUri, "application/xrds+xml", LoadEmbeddedFile("/Discovery/xrdsdiscovery/xrds20dual.xml")); var results = this.Discover(VanityUri).ToList(); @@ -192,7 +192,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { /// <summary> /// Verifies that a dual identifier yields two service endpoints when that feature is turned on. /// </summary> - [TestMethod] + [TestCase] public void DualIdentifier() { this.MockResponder.RegisterMockResponse(VanityUri, "application/xrds+xml", LoadEmbeddedFile("/Discovery/xrdsdiscovery/xrds20dual.xml")); var rp = this.CreateRelyingParty(true); diff --git a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs index 9247bb6..5d914f5 100644 --- a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs @@ -11,11 +11,11 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { using System.Text; using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.RelyingParty; - using Microsoft.VisualStudio.TestTools.UnitTesting; + using NUnit.Framework; - [TestClass] + [TestFixture] public class XriDiscoveryProxyServiceTests : OpenIdTestBase { - [TestMethod] + [TestCase] public void Discover() { string xrds = @"<?xml version='1.0' encoding='UTF-8'?> <XRD version='2.0' xmlns='xri://$xrd*($v*2.0)'> @@ -62,7 +62,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { Assert.AreEqual("=Arnott", se.FriendlyIdentifierForDisplay); } - [TestMethod] + [TestCase] public void DiscoverCommunityInameCanonicalIDs() { string llliResponse = @"<?xml version='1.0' encoding='UTF-8'?> <XRD version='2.0' xmlns='xri://$xrd*($v*2.0)'> @@ -292,7 +292,7 @@ uEyb50RJ7DWmXctSC0b3eymZ2lSXxAWNOsNy this.VerifyCanonicalId("=Web", "=!91F2.8153.F600.AE24"); } - [TestMethod] + [TestCase] public void DiscoveryCommunityInameDelegateWithoutCanonicalID() { this.MockResponder.RegisterMockXrdsResponses(new Dictionary<string, string> { { "https://xri.net/=Web*andrew.arnott?_xrd_r=application/xrd%2Bxml;sep=false", @"<?xml version='1.0' encoding='UTF-8'?> |