コード例 #1
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);
            });
        }
コード例 #2
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);
            });
        }