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 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 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.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 }; }