コード例 #1
0
        public void DisposeOfDisposedTokenShouldReturn()
        {
            var credentials = new TestCredentials();
            var userToken   = new UserTokenClientImpl(AppId, credentials, OauthEndpoint, null, null);

            userToken.Dispose();
            userToken.Dispose();
        }
コード例 #2
0
        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);
            });
        }
コード例 #3
0
        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);
            });
        }
コード例 #4
0
        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);
            });
        }
コード例 #5
0
        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);
            });
        }
コード例 #6
0
        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);
            });
        }
コード例 #7
0
        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);
            });
        }
コード例 #8
0
        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);
            });
        }