Skip to content

Commit

Permalink
Add touch enum tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Jul 1, 2024
1 parent a02a64b commit 5a4a53e
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions src/test/java/org/kohsuke/github/EnumTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.kohsuke.github;

import org.junit.Test;
import org.kohsuke.github.GHPullRequest.MergeMethod;
import org.kohsuke.github.internal.Previews;

import static org.hamcrest.CoreMatchers.*;
Expand Down Expand Up @@ -29,10 +28,14 @@ public void touchEnums() {

assertThat(GHCommentAuthorAssociation.values().length, equalTo(8));

assertThat(GHCommitSearchBuilder.Sort.values().length, equalTo(2));

assertThat(GHCommitState.values().length, equalTo(4));

assertThat(GHCompare.Status.values().length, equalTo(4));

assertThat(GHContentSearchBuilder.Sort.values().length, equalTo(2));

assertThat(GHDeploymentState.values().length, equalTo(7));

assertThat(GHDirection.values().length, equalTo(2));
Expand All @@ -41,10 +44,17 @@ public void touchEnums() {
assertThat(GHEvent.ALL.symbol(), equalTo("*"));
assertThat(GHEvent.PULL_REQUEST.symbol(), equalTo(GHEvent.PULL_REQUEST.toString().toLowerCase()));

assertThat(GHFork.values().length, equalTo(3));
assertThat(GHFork.PARENT_ONLY.toString(), equalTo(""));

assertThat(GHIssueQueryBuilder.Sort.values().length, equalTo(3));

assertThat(GHIssueSearchBuilder.Sort.values().length, equalTo(3));

assertThat(GHIssueState.values().length, equalTo(3));

assertThat(GHIssueStateReason.values().length, equalTo(3));

assertThat(GHMarketplaceAccountType.values().length, equalTo(2));

assertThat(GHMarketplaceListAccountBuilder.Sort.values().length, equalTo(2));
Expand All @@ -65,10 +75,16 @@ public void touchEnums() {
assertThat(GHProject.ProjectState.values().length, equalTo(2));
assertThat(GHProject.ProjectStateFilter.values().length, equalTo(3));

assertThat(MergeMethod.values().length, equalTo(3));
assertThat(GHProjectsV2Item.ContentType.values().length, equalTo(4));

assertThat(GHProjectsV2ItemChanges.FieldType.values().length, equalTo(6));

assertThat(GHPullRequest.MergeMethod.values().length, equalTo(3));

assertThat(GHPullRequestQueryBuilder.Sort.values().length, equalTo(4));

assertThat(GHPullRequestReviewComment.Side.values().length, equalTo(3));

assertThat(GHPullRequestReviewEvent.values().length, equalTo(4));
assertThat(GHPullRequestReviewEvent.PENDING.toState(), equalTo(GHPullRequestReviewState.PENDING));
assertThat(GHPullRequestReviewEvent.PENDING.action(), nullValue());
Expand All @@ -78,20 +94,36 @@ public void touchEnums() {
assertThat(GHPullRequestReviewState.APPROVED.action(), equalTo(GHPullRequestReviewEvent.APPROVE.action()));
assertThat(GHPullRequestReviewState.DISMISSED.toEvent(), nullValue());

assertThat(GHPullRequestSearchBuilder.Sort.values().length, equalTo(4));

assertThat(GHReleaseBuilder.MakeLatest.values().length, equalTo(3));

assertThat(GHRepository.CollaboratorAffiliation.values().length, equalTo(3));
assertThat(GHRepository.ForkSort.values().length, equalTo(3));
assertThat(GHRepository.Visibility.values().length, equalTo(4));

assertThat(GHRepositoryDiscussion.State.values().length, equalTo(3));

assertThat(GHRepositorySearchBuilder.Sort.values().length, equalTo(3));
assertThat(GHRepositorySearchBuilder.Fork.values().length, equalTo(3));
assertThat(GHRepositorySearchBuilder.Fork.PARENT_ONLY.toString(), equalTo(""));

assertThat(GHRepositorySelection.values().length, equalTo(2));

assertThat(GHTargetType.values().length, equalTo(2));

assertThat(GHTeam.Role.values().length, equalTo(2));
assertThat(GHTeam.Privacy.values().length, equalTo(3));

assertThat(GHUserSearchBuilder.Sort.values().length, equalTo(3));

assertThat(GHIssueQueryBuilder.Sort.values().length, equalTo(3));
}
assertThat(GHVerification.Reason.values().length, equalTo(18));

assertThat(GHWorkflowRun.Status.values().length, equalTo(15));
assertThat(GHWorkflowRun.Conclusion.values().length, equalTo(10));

assertThat(MarkdownMode.values().length, equalTo(2));

assertThat(ReactionContent.values().length, equalTo(8));
}
}

0 comments on commit 5a4a53e

Please sign in to comment.