Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 GitHub Provider Integration Tests #182

Open
Strypper opened this issue Mar 16, 2024 · 0 comments
Open

馃殌 GitHub Provider Integration Tests #182

Strypper opened this issue Mar 16, 2024 · 0 comments
Assignees
Labels
effort/medium Medium amount of work, 4h to 16h action level/easy 馃ぉ new feature 馃殌 New feature addition

Comments

@Strypper
Copy link
Owner

Description

The GitHub Service offers a comprehensive suite of functionalities to access repository information, issues, GitHub authors, and more. Currently, the service supports the following operations (with additional functionalities planned for future releases):

IGitHubService

namespace MAUIsland.GitHubProvider;

public interface IGitHubService
{
    Task<GitHubRepositoryModel> GetRepository(string owner, string repository);

    Task<GitHubAuthorModel> GetAuthor(string owner);

    Task<IEnumerable<GitHubIssueModel>> GetGitHubIssues(string owner, string repository);

    Task<IEnumerable<GitHubIssueModel>> GetGitHubIssuesByLabels(string owner, string repository, IEnumerable<string> labels);

    Task<GitHubIssueModel> GetGitHubIssueById(string owner, string repository, string issueNumber);
}

To ensure the integrity of future implementations of the IGitHubService interface, comprehensive integration tests have been developed in the GitHubServiceIntegrationTest class. These tests cover all defined methods, verifying that each method functions correctly under various scenarios. Running these tests against new implementations of IGitHubService ensures consistent behavior across different implementations.

How do you ensure the GitHub data is unchanged to prevent break the test assertions?

The targeted repository will be this all the issues, repository, and author information will remain unchanged for 2 months so the assertions will be enough for this spring

Public API Changes

namespace MAUIsland.GitHubProvider;

public interface IGitHubService
{
    Task<GitHubRepositoryModel> GetRepository(string owner, string repository);

    Task<GitHubAuthorModel> GetAuthor(string owner);

    Task<IEnumerable<GitHubIssueModel>> GetGitHubIssues(string owner, string repository);

    Task<IEnumerable<GitHubIssueModel>> GetGitHubIssuesByLabels(string owner, string repository, IEnumerable<string> labels);

    Task<GitHubIssueModel> GetGitHubIssueById(string owner, string repository, string issueNumber);
}

Intended Use-Case

Test whenever we have GitHub API implementation changes

@Strypper Strypper added new feature 馃殌 New feature addition level/easy 馃ぉ effort/medium Medium amount of work, 4h to 16h action labels Mar 16, 2024
@Strypper Strypper added this to the Hello Internet milestone Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium amount of work, 4h to 16h action level/easy 馃ぉ new feature 馃殌 New feature addition
Projects
Status: In Progress
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants