public IPrincipalExtensionsTests() { this.facebookCredentials = new FacebookCredentials() { UserId = "Facebook:FBUserId", AccessToken = "ABCDEF" }; HttpConfiguration config = new HttpConfiguration(); this.tokenHandlerMock = new Mock<AppServiceTokenHandler>(config) { CallBase = true }; this.tokenHandler = this.tokenHandlerMock.Object; }
public static void SetAppServiceTokenHandler(this HttpConfiguration config, IAppServiceTokenHandler handler) { if (config == null) { throw new ArgumentNullException("config"); } config.Properties[ServiceTokenHandlerKey] = handler; }
public IPrincipalExtensionsTests() { this.facebookCredentials = new FacebookCredentials() { UserId = "Facebook:FBUserId", AccessToken = "ABCDEF" }; HttpConfiguration config = new HttpConfiguration(); this.tokenHandlerMock = new Mock <AppServiceTokenHandler>(config) { CallBase = true }; this.tokenHandler = this.tokenHandlerMock.Object; }
protected override void Initialize(HttpControllerContext controllerContext) { base.Initialize(controllerContext); this.handler = controllerContext.Configuration.GetAppServiceTokenHandler(); }