diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId')
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs | 6 | ||||
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs | 11 | ||||
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/TestSupport.cs | 73 | ||||
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs | 72 | ||||
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs | 8 |
5 files changed, 97 insertions, 73 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs b/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs index 7bc60c7..2b012dd 100644 --- a/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs @@ -50,11 +50,11 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.IsInstanceOfType(id, typeof(UriIdentifier)); Assert.AreEqual(this.uri, ((UriIdentifier)id).Uri.AbsoluteUri); // verify an HTTPS Uri - id = Identifier.Parse(uriHttps); + id = Identifier.Parse(this.uriHttps); Assert.IsInstanceOfType(id, typeof(UriIdentifier)); - Assert.AreEqual(uriHttps, ((UriIdentifier)id).Uri.AbsoluteUri); + Assert.AreEqual(this.uriHttps, ((UriIdentifier)id).Uri.AbsoluteUri); // verify that if the scheme is missing it is added automatically - id = Identifier.Parse(uriNoScheme); + id = Identifier.Parse(this.uriNoScheme); Assert.IsInstanceOfType(id, typeof(UriIdentifier)); Assert.AreEqual(this.uri, ((UriIdentifier)id).Uri.AbsoluteUri); } diff --git a/src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs b/src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs index 7deafef..be795c3 100644 --- a/src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs +++ b/src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs @@ -13,13 +13,14 @@ namespace DotNetOpenAuth.Test.OpenId { using Microsoft.VisualStudio.TestTools.UnitTesting; public class OpenIdTestBase : TestBase { + internal IDirectSslWebRequestHandler RequestHandler; + + internal MockHttpRequest MockResponder; + protected RelyingPartySecuritySettings RelyingPartySecuritySettings { get; private set; } protected ProviderSecuritySettings ProviderSecuritySettings { get; private set; } - internal IDirectSslWebRequestHandler requestHandler; - internal MockHttpRequest mockResponder; - [TestInitialize] public override void SetUp() { base.SetUp(); @@ -27,8 +28,8 @@ namespace DotNetOpenAuth.Test.OpenId { this.RelyingPartySecuritySettings = RelyingPartySection.Configuration.SecuritySettings.CreateSecuritySettings(); this.ProviderSecuritySettings = ProviderSection.Configuration.SecuritySettings.CreateSecuritySettings(); - this.mockResponder = MockHttpRequest.CreateUntrustedMockHttpHandler(); - this.requestHandler = this.mockResponder.MockWebRequestHandler; + this.MockResponder = MockHttpRequest.CreateUntrustedMockHttpHandler(); + this.RequestHandler = this.MockResponder.MockWebRequestHandler; } } } diff --git a/src/DotNetOpenAuth.Test/OpenId/TestSupport.cs b/src/DotNetOpenAuth.Test/OpenId/TestSupport.cs index 4470b99..665c041 100644 --- a/src/DotNetOpenAuth.Test/OpenId/TestSupport.cs +++ b/src/DotNetOpenAuth.Test/OpenId/TestSupport.cs @@ -14,63 +14,80 @@ namespace DotNetOpenAuth.Test.OpenId { using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.RelyingParty; using DotNetOpenAuth.Test.Mocks; - //using DotNetOpenAuth.Test.UI; + ////using DotNetOpenAuth.Test.UI; using log4net; public class TestSupport { - public static readonly string TestWebDirectory = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\src\DotNetOpenId.TestWeb")); public const string HostTestPage = "HostTest.aspx"; + public const string ProviderPage = "ProviderEndpoint.aspx"; + public const string DirectedProviderEndpoint = "DirectedProviderEndpoint.aspx"; + public const string MobileConsumerPage = "RelyingPartyMobile.aspx"; + public const string ConsumerPage = "RelyingParty.aspx"; + public const string OPDefaultPage = "OPDefault.aspx"; - public static Uri ReturnTo { - get { return TestSupport.GetFullUrl(TestSupport.ConsumerPage); } - } - public static Realm Realm { - get { return new Realm(TestSupport.GetFullUrl(TestSupport.ConsumerPage).AbsoluteUri); } - } - public readonly static ILog Logger = LogManager.GetLogger("DotNetOpenId.Test"); + + public static readonly ILog Logger = LogManager.GetLogger("DotNetOpenId.Test"); + + public static readonly string TestWebDirectory = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\src\DotNetOpenId.TestWeb")); + private const string IdentityPage = "IdentityEndpoint.aspx"; + private const string DirectedIdentityPage = "DirectedIdentityEndpoint.aspx"; public enum Scenarios { // Authentication test scenarios AutoApproval, + AutoApprovalAddFragment, + ApproveOnSetup, + AlwaysDeny, - // Extension test scenarios + /* Extension test scenarios */ + /// <summary> /// Provides all required and requested fields. /// </summary> ExtensionFullCooperation, + /// <summary> /// Provides only those fields marked as required. /// </summary> ExtensionPartialCooperation, } + public static Uri ReturnTo { + get { return TestSupport.GetFullUrl(TestSupport.ConsumerPage); } + } + + public static Realm Realm { + get { return new Realm(TestSupport.GetFullUrl(TestSupport.ConsumerPage).AbsoluteUri); } + } + public static Identifier GetDelegateUrl(Scenarios scenario) { return GetDelegateUrl(scenario, false); } - + public static Identifier GetDelegateUrl(Scenarios scenario, bool useSsl) { return new UriIdentifier(GetFullUrl("/" + scenario, null, useSsl)); } - + public static Uri GetFullUrl(string url) { return GetFullUrl(url, null, false); } - + public static Uri GetFullUrl(string url, string key, object value) { - return GetFullUrl(url, new Dictionary<string, string> { - { key, value.ToString() }, - }, false); + var dictionary = new Dictionary<string, string> { + { key, value.ToString() }, + }; + return GetFullUrl(url, dictionary, false); } - + public static Uri GetFullUrl(string url, IDictionary<string, string> args, bool useSsl) { Uri defaultUriBase = new Uri(useSsl ? "https://localhost/" : "http://localhost/"); Uri baseUri = UITestSupport.Host != null ? UITestSupport.Host.BaseUri : defaultUriBase; @@ -84,8 +101,11 @@ namespace DotNetOpenAuth.Test.OpenId { /// </summary> /// <param name="path">The path of the file as it appears within the project, /// where the leading / marks the root directory of the project.</param> + /// <returns>The content of the requested resource.</returns> internal static string LoadEmbeddedFile(string path) { - if (!path.StartsWith("/")) path = "/" + path; + if (!path.StartsWith("/")) { + path = "/" + path; + } path = "DotNetOpenAuth.Test.OpenId" + path.Replace('/', '.'); Stream resource = Assembly.GetExecutingAssembly().GetManifestResourceStream(path); if (resource == null) { @@ -105,23 +125,24 @@ namespace DotNetOpenAuth.Test.OpenId { internal static UriIdentifier GetIdentityUrl(Scenarios scenario, ProtocolVersion providerVersion) { return GetIdentityUrl(scenario, providerVersion, false); } - + internal static UriIdentifier GetIdentityUrl(Scenarios scenario, ProtocolVersion providerVersion, bool useSsl) { - return new UriIdentifier(GetFullUrl("/" + IdentityPage, new Dictionary<string, string> { - { "user", scenario.ToString() }, - { "version", providerVersion.ToString() }, - }, useSsl)); + var dictionary = new Dictionary<string, string> { + { "user", scenario.ToString() }, + { "version", providerVersion.ToString() }, + }; + return new UriIdentifier(GetFullUrl("/" + IdentityPage, dictionary, useSsl)); } - + internal static MockIdentifier GetMockIdentifier(Scenarios scenario, MockHttpRequest mockRequest, ProtocolVersion providerVersion) { return GetMockIdentifier(scenario, mockRequest, providerVersion, false); } - + internal static MockIdentifier GetMockIdentifier(Scenarios scenario, MockHttpRequest mockRequest, ProtocolVersion providerVersion, bool useSsl) { ServiceEndpoint se = GetServiceEndpoint(scenario, providerVersion, 10, useSsl); return new MockIdentifier(GetIdentityUrl(scenario, providerVersion, useSsl), mockRequest, new ServiceEndpoint[] { se }); } - + internal static ServiceEndpoint GetServiceEndpoint(Scenarios scenario, ProtocolVersion providerVersion, int servicePriority, bool useSsl) { return ServiceEndpoint.CreateForClaimedIdentifier( GetIdentityUrl(scenario, providerVersion, useSsl), diff --git a/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs b/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs index 1dfb173..f4433f0 100644 --- a/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs @@ -103,7 +103,7 @@ namespace DotNetOpenAuth.Test.OpenId { public void IsValid() { Assert.IsTrue(UriIdentifier.IsValidUri(this.goodUri)); Assert.IsFalse(UriIdentifier.IsValidUri(this.badUri)); - Assert.IsTrue(UriIdentifier.IsValidUri(relativeUri), "URL lacking http:// prefix should have worked anyway."); + Assert.IsTrue(UriIdentifier.IsValidUri(this.relativeUri), "URL lacking http:// prefix should have worked anyway."); } [TestMethod] @@ -161,8 +161,7 @@ namespace DotNetOpenAuth.Test.OpenId { [TestMethod] public void XrdsDiscoveryFromHead() { - this.mockResponder.RegisterMockResponse(new Uri("http://localhost/xrds1020.xml"), - "application/xrds+xml", TestSupport.LoadEmbeddedFile("/Discovery/xrdsdiscovery/xrds1020.xml")); + this.MockResponder.RegisterMockResponse(new Uri("http://localhost/xrds1020.xml"), "application/xrds+xml", TestSupport.LoadEmbeddedFile("/Discovery/xrdsdiscovery/xrds1020.xml")); this.DiscoverXrds("XrdsReferencedInHead.html", ProtocolVersion.V10, null); } @@ -170,7 +169,7 @@ namespace DotNetOpenAuth.Test.OpenId { public void XrdsDiscoveryFromHttpHeader() { WebHeaderCollection headers = new WebHeaderCollection(); headers.Add("X-XRDS-Location", TestSupport.GetFullUrl("http://localhost/xrds1020.xml").AbsoluteUri); - this.mockResponder.RegisterMockResponse(new Uri("http://localhost/xrds1020.xml"), "application/xrds+xml", TestSupport.LoadEmbeddedFile("/Discovery/xrdsdiscovery/xrds1020.xml")); + this.MockResponder.RegisterMockResponse(new Uri("http://localhost/xrds1020.xml"), "application/xrds+xml", TestSupport.LoadEmbeddedFile("/Discovery/xrdsdiscovery/xrds1020.xml")); this.DiscoverXrds("XrdsReferencedInHttpHeader.html", ProtocolVersion.V10, null, headers); } @@ -215,17 +214,17 @@ namespace DotNetOpenAuth.Test.OpenId { [TestMethod] public void DiscoveryWithRedirects() { - Identifier claimedId = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.mockResponder, ProtocolVersion.V20); + Identifier claimedId = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.MockResponder, ProtocolVersion.V20); // Add a couple of chained redirect pages that lead to the claimedId. Uri userSuppliedUri = TestSupport.GetFullUrl("/someSecurePage", null, true); Uri insecureMidpointUri = TestSupport.GetFullUrl("/insecureStop"); - this.mockResponder.RegisterMockRedirect(userSuppliedUri, insecureMidpointUri); - this.mockResponder.RegisterMockRedirect(insecureMidpointUri, new Uri(claimedId.ToString())); + this.MockResponder.RegisterMockRedirect(userSuppliedUri, insecureMidpointUri); + this.MockResponder.RegisterMockRedirect(insecureMidpointUri, new Uri(claimedId.ToString())); // don't require secure SSL discovery for this test. Identifier userSuppliedIdentifier = new UriIdentifier(userSuppliedUri, false); - Assert.AreEqual(1, userSuppliedIdentifier.Discover(this.requestHandler).Count()); + Assert.AreEqual(1, userSuppliedIdentifier.Discover(this.RequestHandler).Count()); } [TestMethod] @@ -249,80 +248,81 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.IsFalse(id.TryRequireSsl(out secureId)); Assert.IsFalse(secureId.IsDiscoverySecureEndToEnd); Assert.AreEqual("http://www.yahoo.com/", secureId.ToString()); - Assert.AreEqual(0, secureId.Discover(this.requestHandler).Count()); + Assert.AreEqual(0, secureId.Discover(this.RequestHandler).Count()); id = new UriIdentifier("http://www.yahoo.com"); Assert.IsFalse(id.TryRequireSsl(out secureId)); Assert.IsFalse(secureId.IsDiscoverySecureEndToEnd); Assert.AreEqual("http://www.yahoo.com/", secureId.ToString()); - Assert.AreEqual(0, secureId.Discover(this.requestHandler).Count()); + Assert.AreEqual(0, secureId.Discover(this.RequestHandler).Count()); } [TestMethod] public void DiscoverRequireSslWithSecureRedirects() { - Identifier claimedId = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.mockResponder, ProtocolVersion.V20, true); + Identifier claimedId = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.MockResponder, ProtocolVersion.V20, true); // Add a couple of chained redirect pages that lead to the claimedId. // All redirects should be secure. Uri userSuppliedUri = TestSupport.GetFullUrl("/someSecurePage", null, true); Uri secureMidpointUri = TestSupport.GetFullUrl("/secureStop", null, true); - this.mockResponder.RegisterMockRedirect(userSuppliedUri, secureMidpointUri); - this.mockResponder.RegisterMockRedirect(secureMidpointUri, new Uri(claimedId.ToString())); + this.MockResponder.RegisterMockRedirect(userSuppliedUri, secureMidpointUri); + this.MockResponder.RegisterMockRedirect(secureMidpointUri, new Uri(claimedId.ToString())); Identifier userSuppliedIdentifier = new UriIdentifier(userSuppliedUri, true); - Assert.AreEqual(1, userSuppliedIdentifier.Discover(this.requestHandler).Count()); + Assert.AreEqual(1, userSuppliedIdentifier.Discover(this.RequestHandler).Count()); } [TestMethod, ExpectedException(typeof(ProtocolException))] public void DiscoverRequireSslWithInsecureRedirect() { - Identifier claimedId = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.mockResponder, ProtocolVersion.V20, true); + Identifier claimedId = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.MockResponder, ProtocolVersion.V20, true); // Add a couple of chained redirect pages that lead to the claimedId. // Include an insecure HTTP jump in those redirects to verify that // the ultimate endpoint is never found as a result of high security profile. Uri userSuppliedUri = TestSupport.GetFullUrl("/someSecurePage", null, true); Uri insecureMidpointUri = TestSupport.GetFullUrl("/insecureStop"); - this.mockResponder.RegisterMockRedirect(userSuppliedUri, insecureMidpointUri); - this.mockResponder.RegisterMockRedirect(insecureMidpointUri, new Uri(claimedId.ToString())); + this.MockResponder.RegisterMockRedirect(userSuppliedUri, insecureMidpointUri); + this.MockResponder.RegisterMockRedirect(insecureMidpointUri, new Uri(claimedId.ToString())); Identifier userSuppliedIdentifier = new UriIdentifier(userSuppliedUri, true); - userSuppliedIdentifier.Discover(this.requestHandler); + userSuppliedIdentifier.Discover(this.RequestHandler); } [TestMethod] public void DiscoveryRequireSslWithInsecureXrdsInSecureHtmlHead() { - var insecureXrdsSource = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.mockResponder, ProtocolVersion.V20, false); + var insecureXrdsSource = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.MockResponder, ProtocolVersion.V20, false); Uri secureClaimedUri = TestSupport.GetFullUrl("/secureId", null, true); string html = string.Format("<html><head><meta http-equiv='X-XRDS-Location' content='{0}'/></head><body></body></html>", insecureXrdsSource); - this.mockResponder.RegisterMockResponse(secureClaimedUri, "text/html", html); + this.MockResponder.RegisterMockResponse(secureClaimedUri, "text/html", html); Identifier userSuppliedIdentifier = new UriIdentifier(secureClaimedUri, true); - Assert.AreEqual(0, userSuppliedIdentifier.Discover(this.requestHandler).Count()); + Assert.AreEqual(0, userSuppliedIdentifier.Discover(this.RequestHandler).Count()); } [TestMethod] public void DiscoveryRequireSslWithInsecureXrdsInSecureHttpHeader() { - var insecureXrdsSource = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.mockResponder, ProtocolVersion.V20, false); + var insecureXrdsSource = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.MockResponder, ProtocolVersion.V20, false); Uri secureClaimedUri = TestSupport.GetFullUrl("/secureId", null, true); string html = "<html><head></head><body></body></html>"; WebHeaderCollection headers = new WebHeaderCollection { { "X-XRDS-Location", insecureXrdsSource } }; - this.mockResponder.RegisterMockResponse(secureClaimedUri, secureClaimedUri, "text/html", headers, html); + this.MockResponder.RegisterMockResponse(secureClaimedUri, secureClaimedUri, "text/html", headers, html); Identifier userSuppliedIdentifier = new UriIdentifier(secureClaimedUri, true); - Assert.AreEqual(0, userSuppliedIdentifier.Discover(this.requestHandler).Count()); + Assert.AreEqual(0, userSuppliedIdentifier.Discover(this.RequestHandler).Count()); } [TestMethod] public void DiscoveryRequireSslWithInsecureXrdsButSecureLinkTags() { - var insecureXrdsSource = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.mockResponder, ProtocolVersion.V20, false); + var insecureXrdsSource = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.MockResponder, ProtocolVersion.V20, false); Uri secureClaimedUri = TestSupport.GetFullUrl("/secureId", null, true); Identifier localIdForLinkTag = TestSupport.GetDelegateUrl(TestSupport.Scenarios.AlwaysDeny, true); - string html = string.Format(@" + string html = string.Format( + @" <html><head> <meta http-equiv='X-XRDS-Location' content='{0}'/> <!-- this one will be insecure and ignored --> <link rel='openid2.provider' href='{1}' /> @@ -331,10 +331,10 @@ namespace DotNetOpenAuth.Test.OpenId { HttpUtility.HtmlEncode(insecureXrdsSource), HttpUtility.HtmlEncode(TestSupport.GetFullUrl("/" + TestSupport.ProviderPage, null, true).AbsoluteUri), HttpUtility.HtmlEncode(localIdForLinkTag.ToString())); - this.mockResponder.RegisterMockResponse(secureClaimedUri, "text/html", html); + this.MockResponder.RegisterMockResponse(secureClaimedUri, "text/html", html); Identifier userSuppliedIdentifier = new UriIdentifier(secureClaimedUri, true); - Assert.AreEqual(localIdForLinkTag, userSuppliedIdentifier.Discover(this.requestHandler).Single().ProviderLocalIdentifier); + Assert.AreEqual(localIdForLinkTag, userSuppliedIdentifier.Discover(this.RequestHandler).Single().ProviderLocalIdentifier); } [TestMethod] @@ -342,8 +342,8 @@ namespace DotNetOpenAuth.Test.OpenId { var insecureEndpoint = TestSupport.GetServiceEndpoint(TestSupport.Scenarios.AutoApproval, ProtocolVersion.V20, 10, false); var secureEndpoint = TestSupport.GetServiceEndpoint(TestSupport.Scenarios.ApproveOnSetup, ProtocolVersion.V20, 20, true); UriIdentifier secureClaimedId = new UriIdentifier(TestSupport.GetFullUrl("/claimedId", null, true), true); - this.mockResponder.RegisterMockXrdsResponse(secureClaimedId, new ServiceEndpoint[] { insecureEndpoint, secureEndpoint }); - Assert.AreEqual(secureEndpoint.ProviderLocalIdentifier, secureClaimedId.Discover(this.requestHandler).Single().ProviderLocalIdentifier); + this.MockResponder.RegisterMockXrdsResponse(secureClaimedId, new ServiceEndpoint[] { insecureEndpoint, secureEndpoint }); + Assert.AreEqual(secureEndpoint.ProviderLocalIdentifier, secureClaimedId.Discover(this.RequestHandler).Single().ProviderLocalIdentifier); } private void Discover(string url, ProtocolVersion version, Identifier expectedLocalId, bool expectSreg, bool useRedirect) { @@ -368,9 +368,9 @@ namespace DotNetOpenAuth.Test.OpenId { } else { throw new InvalidOperationException(); } - this.mockResponder.RegisterMockResponse(new Uri(idToDiscover), claimedId, contentType, headers ?? new WebHeaderCollection(), TestSupport.LoadEmbeddedFile(url)); + this.MockResponder.RegisterMockResponse(new Uri(idToDiscover), claimedId, contentType, headers ?? new WebHeaderCollection(), TestSupport.LoadEmbeddedFile(url)); - ServiceEndpoint se = idToDiscover.Discover(this.requestHandler).FirstOrDefault(); + ServiceEndpoint se = idToDiscover.Discover(this.RequestHandler).FirstOrDefault(); Assert.IsNotNull(se, url + " failed to be discovered."); Assert.AreSame(protocol, se.Protocol); Assert.AreEqual(claimedId, se.ClaimedIdentifier); @@ -387,7 +387,9 @@ namespace DotNetOpenAuth.Test.OpenId { } private void DiscoverXrds(string page, ProtocolVersion version, Identifier expectedLocalId, WebHeaderCollection headers) { - if (!page.Contains(".")) page += ".xml"; + if (!page.Contains(".")) { + page += ".xml"; + } this.Discover("/Discovery/xrdsdiscovery/" + page, version, expectedLocalId, true, false, headers); this.Discover("/Discovery/xrdsdiscovery/" + page, version, expectedLocalId, true, true, headers); } @@ -405,9 +407,9 @@ namespace DotNetOpenAuth.Test.OpenId { private void FailDiscover(string url) { UriIdentifier userSuppliedId = TestSupport.GetFullUrl(url); - this.mockResponder.RegisterMockResponse(new Uri(userSuppliedId), userSuppliedId, "text/html", TestSupport.LoadEmbeddedFile(url)); + this.MockResponder.RegisterMockResponse(new Uri(userSuppliedId), userSuppliedId, "text/html", TestSupport.LoadEmbeddedFile(url)); - Assert.AreEqual(0, userSuppliedId.Discover(this.requestHandler).Count()); // ... but that no endpoint info is discoverable + Assert.AreEqual(0, userSuppliedId.Discover(this.RequestHandler).Count()); // ... but that no endpoint info is discoverable } private void FailDiscoverHtml(string scenario) { diff --git a/src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs b/src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs index 4d349ff..b6b2e55 100644 --- a/src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs @@ -125,7 +125,7 @@ namespace DotNetOpenAuth.Test.OpenId { { "https://xri.net/=Arnott?_xrd_r=application/xrd%2Bxml;sep=false", xrds }, { "https://xri.net/=!9B72.7DD1.50A9.5CCD?_xrd_r=application/xrd%2Bxml;sep=false", xrds }, }; - this.mockResponder.RegisterMockXrdsResponses(mocks); + this.MockResponder.RegisterMockXrdsResponses(mocks); string expectedCanonicalId = "=!9B72.7DD1.50A9.5CCD"; ServiceEndpoint se = this.VerifyCanonicalId("=Arnott", expectedCanonicalId); @@ -351,7 +351,7 @@ uEyb50RJ7DWmXctSC0b3eymZ2lSXxAWNOsNy </X509Data> </KeyInfo> </XRD>"; - this.mockResponder.RegisterMockXrdsResponses(new Dictionary<string, string> { + this.MockResponder.RegisterMockXrdsResponses(new Dictionary<string, string> { { "https://xri.net/@llli?_xrd_r=application/xrd%2Bxml;sep=false", llliResponse }, { "https://xri.net/@llli*area?_xrd_r=application/xrd%2Bxml;sep=false", llliAreaResponse }, { "https://xri.net/@llli*area*canada.unattached?_xrd_r=application/xrd%2Bxml;sep=false", llliAreaCanadaUnattachedResponse }, @@ -367,7 +367,7 @@ uEyb50RJ7DWmXctSC0b3eymZ2lSXxAWNOsNy [TestMethod] public void DiscoveryCommunityInameDelegateWithoutCanonicalID() { - this.mockResponder.RegisterMockXrdsResponses(new Dictionary<string, string> { + 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'?> <XRD xmlns='xri://$xrd*($v*2.0)'> <Query>*andrew.arnott</Query> @@ -459,7 +459,7 @@ uEyb50RJ7DWmXctSC0b3eymZ2lSXxAWNOsNy } private ServiceEndpoint VerifyCanonicalId(Identifier iname, string expectedClaimedIdentifier) { - ServiceEndpoint se = iname.Discover(this.requestHandler).FirstOrDefault(); + ServiceEndpoint se = iname.Discover(this.RequestHandler).FirstOrDefault(); if (expectedClaimedIdentifier != null) { Assert.IsNotNull(se); Assert.AreEqual(expectedClaimedIdentifier, se.ClaimedIdentifier.ToString(), "i-name {0} discovery resulted in unexpected CanonicalId", iname); |