diff options
Diffstat (limited to 'src/OpenID/OpenIdProviderMvc/Code/IFormsAuthentication.cs')
-rw-r--r-- | src/OpenID/OpenIdProviderMvc/Code/IFormsAuthentication.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/OpenID/OpenIdProviderMvc/Code/IFormsAuthentication.cs b/src/OpenID/OpenIdProviderMvc/Code/IFormsAuthentication.cs new file mode 100644 index 0000000..d4c8a01 --- /dev/null +++ b/src/OpenID/OpenIdProviderMvc/Code/IFormsAuthentication.cs @@ -0,0 +1,24 @@ +namespace OpenIdProviderMvc.Code { + using System; + using System.Collections.Generic; + using System.Linq; + using System.Web; +using System.Web.Security; + + /// <summary> + /// An interface that wraps the <see cref="FormsAuthentication"/> type. + /// </summary> + /// <remarks> + /// The FormsAuthentication type is sealed and contains static members, so it is difficult to + /// unit test code that calls its members. The interface and helper class below demonstrate + /// how to create an abstract wrapper around such a type in order to make the AccountController + /// code unit testable. + /// </remarks> + public interface IFormsAuthentication { + string SignedInUsername { get; } + + void SignIn(string userName, bool createPersistentCookie); + + void SignOut(); + } +} |