diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-08-31 22:20:01 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-08-31 22:20:01 -0700 |
commit | 0488ebcfaef60e51bfcf7958b4a59d0ba5332a0f (patch) | |
tree | a6681a912fab62ccf5e8e005ac382f6bcfb34a4b /src/DotNetOpenAuth.Test/Mocks/MockRealm.cs | |
parent | 0918f556a7da5f731b97cb4bbaa1ee5349c29d41 (diff) | |
parent | 307ba2d4b5ad4574a52922b40027ea978e3d8a04 (diff) | |
download | DotNetOpenAuth-0488ebcfaef60e51bfcf7958b4a59d0ba5332a0f.zip DotNetOpenAuth-0488ebcfaef60e51bfcf7958b4a59d0ba5332a0f.tar.gz DotNetOpenAuth-0488ebcfaef60e51bfcf7958b4a59d0ba5332a0f.tar.bz2 |
Merge branch 'v3.0' into v3.1
Conflicts:
src/DotNetOpenAuth.vsmdi
src/DotNetOpenAuth/OpenId/OpenIdStrings.Designer.cs
src/DotNetOpenAuth/OpenId/OpenIdStrings.resx
Diffstat (limited to 'src/DotNetOpenAuth.Test/Mocks/MockRealm.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/Mocks/MockRealm.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/Mocks/MockRealm.cs b/src/DotNetOpenAuth.Test/Mocks/MockRealm.cs new file mode 100644 index 0000000..4e29bba --- /dev/null +++ b/src/DotNetOpenAuth.Test/Mocks/MockRealm.cs @@ -0,0 +1,42 @@ +//----------------------------------------------------------------------- +// <copyright file="MockRealm.cs" company="Andrew Arnott"> +// Copyright (c) Andrew Arnott. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace DotNetOpenAuth.Test.Mocks { + using System.Collections.Generic; + using DotNetOpenAuth.Messaging; + using DotNetOpenAuth.OpenId; + + internal class MockRealm : Realm { + private RelyingPartyEndpointDescription[] relyingPartyDescriptions; + + /// <summary> + /// Initializes a new instance of the <see cref="MockRealm"/> class. + /// </summary> + /// <param name="wrappedRealm">The wrapped realm.</param> + /// <param name="relyingPartyDescriptions">The relying party descriptions.</param> + internal MockRealm(Realm wrappedRealm, params RelyingPartyEndpointDescription[] relyingPartyDescriptions) + : base(wrappedRealm) { + ErrorUtilities.VerifyArgumentNotNull(relyingPartyDescriptions, "relyingPartyDescriptions"); + + this.relyingPartyDescriptions = relyingPartyDescriptions; + } + + /// <summary> + /// Searches for an XRDS document at the realm URL, and if found, searches + /// for a description of a relying party endpoints (OpenId login pages). + /// </summary> + /// <param name="requestHandler">The mechanism to use for sending HTTP requests.</param> + /// <param name="allowRedirects">Whether redirects may be followed when discovering the Realm. + /// This may be true when creating an unsolicited assertion, but must be + /// false when performing return URL verification per 2.0 spec section 9.2.1.</param> + /// <returns> + /// The details of the endpoints if found, otherwise null. + /// </returns> + internal override IEnumerable<RelyingPartyEndpointDescription> Discover(IDirectWebRequestHandler requestHandler, bool allowRedirects) { + return this.relyingPartyDescriptions; + } + } +} |