blob: 09856e9589b740d69116574c1bdc8cc72110bba7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
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; }
DateTime? SignedInTimestampUtc { get; }
void SignIn(string userName, bool createPersistentCookie);
void SignOut();
}
}
|