π GitHub Provider Integration Tests
Strypper opened this issue Β· comments
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
Implemented