public void Setup() { this.appConfig = new AppConfig(); this.authenticationProvider = new MockAuthenticationProvider(); this.authenticationProvider.Setup(provider => provider.AuthenticateAsync()).Returns(Task.FromResult(new AccountSession())); this.authenticationProvider.Setup(provider => provider.AppendAuthHeaderAsync(It.IsAny<HttpRequestMessage>())).Returns(Task.FromResult(0)); this.credentialCache = new MockCredentialCache(); this.serializer = new MockSerializer(); this.httpResponseMessage = new HttpResponseMessage(); this.httpProvider = new MockHttpProvider(this.httpResponseMessage, this.serializer.Object); this.serviceInfo = new ServiceInfo { AuthenticationProvider = this.authenticationProvider.Object, }; this.serviceInfoProvider = new MockServiceInfoProvider(this.serviceInfo); this.webUi = new MockWebAuthenticationUi(); this.oneDriveClient = new OneDriveClient( this.appConfig, this.credentialCache.Object, this.httpProvider.Object, this.serviceInfoProvider.Object) { BaseUrl = string.Format(Constants.Authentication.OneDriveConsumerBaseUrlFormatString, "v1.0"), ServiceInfo = this.serviceInfo, }; }
public void Setup() { this.appConfig = new AppConfig(); this.authenticationProvider = new MockAuthenticationProvider(); this.authenticationProvider.Setup(provider => provider.AppendAuthHeaderAsync(It.IsAny <HttpRequestMessage>())).Returns(Task.FromResult(0)); this.credentialCache = new MockCredentialCache(); this.serializer = new MockSerializer(); this.httpResponseMessage = new HttpResponseMessage(); this.httpProvider = new MockHttpProvider(this.httpResponseMessage, this.serializer.Object); this.serviceInfo = new ServiceInfo { AuthenticationProvider = this.authenticationProvider.Object, }; this.serviceInfoProvider = new MockServiceInfoProvider(this.serviceInfo); this.webUi = new MockWebUi(); this.oneDriveClient = new OneDriveClient( this.appConfig, this.credentialCache.Object, this.httpProvider.Object, this.serviceInfoProvider.Object) { BaseUrl = Constants.Authentication.OneDriveConsumerBaseUrl, ServiceInfo = this.serviceInfo, }; }
public virtual void Setup() { this.httpResponseMessage = new HttpResponseMessage(); this.credentialCache = new MockCredentialCache(); this.serializer = new MockSerializer(); this.httpProvider = new MockHttpProvider(this.httpResponseMessage, this.serializer.Object); this.webAuthenticationUi = new MockWebAuthenticationUi(); this.oAuthHelper = new OAuthHelper(); }
public void Setup() { this.credentialCache = new MockCredentialCache(); this.webAuthenticationUi = new MockWebAuthenticationUi(); this.webAuthenticationUi.OnAuthenticateAsync = this.OnAuthenticateAsync; this.authenticationProvider = new MsaAuthenticationProvider( this.clientId, this.returnUrl, this.scopes, this.credentialCache); this.authenticationProvider.webAuthenticationUi = this.webAuthenticationUi; }
public void Setup() { this.appConfig = new AppConfig { MicrosoftAccountAppId = "12345", MicrosoftAccountClientSecret = "secret", MicrosoftAccountReturnUrl = "https://localhost/return", MicrosoftAccountScopes = new string[] { "scope" } }; this.credentialCache = new MockCredentialCache(); this.httpResponseMessage = new HttpResponseMessage(); this.httpProvider = new MockHttpProvider(this.httpResponseMessage); this.webAuthenticationUi = new MockWebUi(); this.serviceInfoProvider = new ServiceInfoProvider(this.webAuthenticationUi.Object); }
public void Setup() { this.appConfig = new AppConfig { MicrosoftAccountAppId = "12345", MicrosoftAccountClientSecret = "secret", MicrosoftAccountReturnUrl = "https://localhost/return", MicrosoftAccountScopes = new string[] { "scope" } }; this.credentialCache = new MockCredentialCache(); this.httpResponseMessage = new HttpResponseMessage(); this.httpProvider = new MockHttpProvider(this.httpResponseMessage); this.webAuthenticationUi = new MockWebUi(); this.serviceInfoProvider = new ServiceInfoProvider(this.webAuthenticationUi.Object); }
public virtual void Setup() { this.httpResponseMessage = new HttpResponseMessage(); this.credentialCache = new MockCredentialCache(); this.serializer = new MockSerializer(); this.httpProvider = new MockHttpProvider(this.httpResponseMessage, this.serializer.Object); this.webAuthenticationUi = new MockWebAuthenticationUi(); this.authenticationProvider = new MsaAuthenticationProvider( MsaAuthenticationProviderTests.ClientId, MsaAuthenticationProviderTests.ClientSecret, MsaAuthenticationProviderTests.ReturnUrl, this.scopes, this.credentialCache.Object); this.authenticationProvider.webAuthenticationUi = this.webAuthenticationUi.Object; }
public void Setup() { this.credentialCache = new MockCredentialCache(); this.webAuthenticationUi = new MockWebAuthenticationUi(); this.webAuthenticationUi.OnAuthenticateAsync = this.OnAuthenticateAsync; this.serviceInfo = new ServiceInfo { AppId = "12345", AuthenticationServiceUrl = "https://login.live.com/authenticate", CredentialCache = this.credentialCache, Scopes = new string[] { "scope1", "scope2" }, SignOutUrl = "https://login.live.com/signout", TokenServiceUrl = "https://login.live.com/token", WebAuthenticationUi = this.webAuthenticationUi }; this.authenticationProvider = new WebAuthenticationBrokerAuthenticationProvider(this.serviceInfo); }
public void Setup() { this.credentialCache = new MockCredentialCache(); this.webAuthenticationUi = new MockWebAuthenticationUi(); this.webAuthenticationUi.OnAuthenticateAsync = this.OnAuthenticateAsync; this.serviceInfo = new ServiceInfo { AppId = "12345", AuthenticationServiceUrl = "https://login.live.com/authenticate", CredentialCache = this.credentialCache, Scopes = new string[] { "scope1", "scope2" }, SignOutUrl = "https://login.live.com/signout", TokenServiceUrl = "https://login.live.com/token", WebAuthenticationUi = this.webAuthenticationUi }; this.authenticationProvider = new WebAuthenticationBrokerAuthenticationProvider(this.serviceInfo); }
public virtual void Setup() { this.httpResponseMessage = new HttpResponseMessage(); this.credentialCache = new MockCredentialCache(); this.serializer = new MockSerializer(); this.httpProvider = new MockHttpProvider(this.httpResponseMessage, this.serializer.Object); this.webAuthenticationUi = new MockWebAuthenticationUi(); this.serviceInfo = new ServiceInfo { AppId = "12345", AuthenticationServiceUrl = "https://login.live.com/authenticate", CredentialCache = this.credentialCache.Object, HttpProvider = this.httpProvider.Object, ReturnUrl = "https://login.live.com/return", Scopes = new string[] { "scope1", "scope2" }, SignOutUrl = "https://login.live.com/signout", TokenServiceUrl = "https://login.live.com/token", WebAuthenticationUi = this.webAuthenticationUi.Object }; }
public virtual void Setup() { this.httpResponseMessage = new HttpResponseMessage(); this.credentialCache = new MockCredentialCache(); this.serializer = new MockSerializer(); this.httpProvider = new MockHttpProvider(this.httpResponseMessage, this.serializer.Object); this.webUi = new MockWebUi(); this.serviceInfo = new ServiceInfo { AppId = "12345", AuthenticationServiceUrl = "https://login.live.com/authenticate", CredentialCache = this.credentialCache.Object, HttpProvider = this.httpProvider.Object, ReturnUrl = "https://login.live.com/return", Scopes = new string[] { "scope1", "scope2" }, SignOutUrl = "https://login.live.com/signout", TokenServiceUrl = "https://login.live.com/token", WebAuthenticationUi = this.webUi.Object }; }