Exemplo n.º 1
0
        public async Task GenerateGitTrendsOAuthToken_InvalidDTO()
        {
            //Arrange
            GitHubToken?gitHubToken;
            var         generateTokenDTO         = new GenerateTokenDTO(string.Empty, string.Empty);
            var         azureFunctionsApiService = new AzureFunctionsApiService(new MockAnalyticsService(), new MockMainThread());

            //Act
            gitHubToken = await azureFunctionsApiService.GenerateGitTrendsOAuthToken(generateTokenDTO, CancellationToken.None).ConfigureAwait(false);

            //Assert
            Assert.IsNotNull(gitHubToken);
            Assert.IsEmpty(GitHubToken.Empty.AccessToken);
            Assert.IsEmpty(GitHubToken.Empty.Scope);
            Assert.IsEmpty(GitHubToken.Empty.TokenType);
        }
        public async Task GenerateGitTrendsOAuthTokenTest_InvalidDTO()
        {
            //Arrange
            GitHubToken?gitHubToken;
            var         generateTokenDTO         = new GenerateTokenDTO(string.Empty, string.Empty);
            var         azureFunctionsApiService = ServiceCollection.ServiceProvider.GetRequiredService <AzureFunctionsApiService>();

            //Act
            gitHubToken = await azureFunctionsApiService.GenerateGitTrendsOAuthToken(generateTokenDTO, CancellationToken.None).ConfigureAwait(false);

            //Assert
            Assert.IsNotNull(gitHubToken);
            Assert.IsEmpty(GitHubToken.Empty.AccessToken);
            Assert.IsEmpty(GitHubToken.Empty.Scope);
            Assert.IsEmpty(GitHubToken.Empty.TokenType);
        }
Exemplo n.º 3
0
 public Task <GitHubToken> GenerateGitTrendsOAuthToken(GenerateTokenDTO generateTokenDTO) => AttemptAndRetry_Mobile(() => AzureFunctionsApiClient.GenerateGitTrendsOAuthToken(generateTokenDTO));
 public Task <GitHubToken> GenerateGitTrendsOAuthToken(GenerateTokenDTO generateTokenDTO, CancellationToken cancellationToken) => AttemptAndRetry_Mobile(() => _azureFunctionsApiClient.GenerateGitTrendsOAuthToken(generateTokenDTO), cancellationToken);