Пример #1
0
        public async Task GetAccessTokenAsync_WithValidTokenRequest_ReturnsAccessToken()
        {
            // Given: We fetch create a token request
            string        authCode      = "abcde"; // Set a valid access token here
            ConnectClient connectClient = new ConnectClient(this.ClientId, this.ClientSecret);
            TokenRequest  tokenRequest  = new TokenRequest(authCode, DefaultRedirectUrl);

            // When: We request the auth code
            TokenResponse tokenResponse = await connectClient.GetAccessTokenAsync(tokenRequest);

            // Then: The access token should not be null
            Assert.IsFalse(string.IsNullOrEmpty(tokenResponse.AccessToken));
        }