public void DisposeOfDisposedTokenShouldReturn() { var credentials = new TestCredentials(); var userToken = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null); userToken.Dispose(); userToken.Dispose(); }
public async Task GetSignInResourceAsyncWithNullConnectionNameShouldThrow() { var credentials = new TestCredentials(); var userToken = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null); await Assert.ThrowsAsync <ArgumentNullException>(async() => { await userToken.GetSignInResourceAsync(null, new Activity(), "final-redirect", CancellationToken.None); }); }
public async Task GetUserTokenAsyncWithNullConnectionNameShouldThrow() { var credentials = new TestCredentials(); var userToken = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null); await Assert.ThrowsAsync <ArgumentNullException>(async() => { await userToken.GetUserTokenAsync(UserId, null, ChannelId, MagicCode, CancellationToken.None); }); }
public async Task GetTokenStatusAsyncWithNullUserIdShouldThrow() { var credentials = new TestCredentials(); var userToken = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null); await Assert.ThrowsAsync <ArgumentNullException>(async() => { await userToken.GetTokenStatusAsync(null, ChannelId, "filter", CancellationToken.None); }); }
public async Task GetSignInResourceAsyncOfDisposedTokenShouldThrow() { var credentials = new TestCredentials(); var userToken = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null); userToken.Dispose(); await Assert.ThrowsAsync <ObjectDisposedException>(async() => { await userToken.GetSignInResourceAsync(ConnectionName, new Activity(), "final-redirect", CancellationToken.None); }); }
public async Task GetUserTokenAsyncOfDisposedTokenShouldThrow() { var credentials = new TestCredentials(); var userToken = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null); userToken.Dispose(); await Assert.ThrowsAsync <ObjectDisposedException>(async() => { await userToken.GetUserTokenAsync(UserId, ConnectionName, ChannelId, MagicCode, CancellationToken.None); }); }
public async Task ExchangeTokenAsyncWithNullUserIdShouldThrow() { var credentials = new TestCredentials(); var userToken = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null); var tokenExchange = new TokenExchangeRequest(); await Assert.ThrowsAsync <ArgumentNullException>(async() => { await userToken.ExchangeTokenAsync(null, ChannelId, ChannelId, tokenExchange, CancellationToken.None); }); }
public async Task GetAadTokensAsyncWithNullConnectionNameShouldThrow() { var credentials = new TestCredentials(); var userToken = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null); string[] resourceUrls = { "https://test.url" }; await Assert.ThrowsAsync <ArgumentNullException>(async() => { await userToken.GetAadTokensAsync(UserId, null, resourceUrls, ChannelId, CancellationToken.None); }); }