summaryrefslogtreecommitdiffstats
path: root/samples/OpenIdProviderMvc/Code/IFormsAuthentication.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-03-16 09:22:08 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-03-16 09:22:08 -0700
commit45068758daa9d7747565af3f95bea7abfa2db54a (patch)
treeb11c17d32763b77e4bfc03005e202b0c14e8bbdf /samples/OpenIdProviderMvc/Code/IFormsAuthentication.cs
parente72da4887ebf36073d1235e28e44b44004602311 (diff)
downloadDotNetOpenAuth-45068758daa9d7747565af3f95bea7abfa2db54a.zip
DotNetOpenAuth-45068758daa9d7747565af3f95bea7abfa2db54a.tar.gz
DotNetOpenAuth-45068758daa9d7747565af3f95bea7abfa2db54a.tar.bz2
Added ASP.NET MVC OpenID Provider sample.
Diffstat (limited to 'samples/OpenIdProviderMvc/Code/IFormsAuthentication.cs')
-rw-r--r--samples/OpenIdProviderMvc/Code/IFormsAuthentication.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/samples/OpenIdProviderMvc/Code/IFormsAuthentication.cs b/samples/OpenIdProviderMvc/Code/IFormsAuthentication.cs
new file mode 100644
index 0000000..d4c8a01
--- /dev/null
+++ b/samples/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();
+ }
+}