Search in sources :

Example 11 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testCreateBranchEvent.

/**
 * Verify text of create event
 */
@UiThreadTest
public void testCreateBranchEvent() {
    CreatePayload payload = CreatePayload.builder().refType(ReferenceType.Branch).ref("b1").build();
    GitHubEvent event = createEvent(GitHubEventType.CreateEvent, payload);
    updateView(event);
    verify("user created branch b1 at user/repo");
}
Also used : CreatePayload(com.meisolsson.githubsdk.model.payload.CreatePayload) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Example 12 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testAddMember.

/**
 * Verify text of member event
 */
@UiThreadTest
public void testAddMember() {
    User user = User.builder().login("person").build();
    MemberPayload payload = MemberPayload.builder().member(user).build();
    GitHubEvent event = createEvent(GitHubEventType.MemberEvent, payload);
    updateView(event);
    verify("user added person as a collaborator to user/repo");
}
Also used : MemberPayload(com.meisolsson.githubsdk.model.payload.MemberPayload) User(com.meisolsson.githubsdk.model.User) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Example 13 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testIssueComment.

/**
 * Verify text of issue comment event
 */
@UiThreadTest
public void testIssueComment() {
    Issue issue = Issue.builder().number(5).build();
    IssueCommentPayload payload = IssueCommentPayload.builder().issue(issue).build();
    GitHubEvent event = createEvent(GitHubEventType.IssueCommentEvent, payload);
    updateView(event);
    verify("user commented on issue 5 on user/repo");
}
Also used : Issue(com.meisolsson.githubsdk.model.Issue) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) IssueCommentPayload(com.meisolsson.githubsdk.model.payload.IssueCommentPayload) UiThreadTest(android.test.UiThreadTest)

Example 14 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testWiki.

/**
 * Verify text of wiki event
 */
@UiThreadTest
public void testWiki() {
    GitHubEvent event = createEvent(GitHubEventType.GollumEvent, null);
    updateView(event);
    verify("user updated the wiki in user/repo");
}
Also used : GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Example 15 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testIssue.

/**
 * Verify text of issue event
 */
@UiThreadTest
public void testIssue() {
    Issue issue = Issue.builder().number(8).build();
    IssuesPayload payload = IssuesPayload.builder().action(IssuesPayload.Action.Closed).issue(issue).build();
    GitHubEvent event = createEvent(GitHubEventType.IssuesEvent, payload);
    updateView(event);
    verify("user closed issue 8 on user/repo");
}
Also used : Issue(com.meisolsson.githubsdk.model.Issue) IssuesPayload(com.meisolsson.githubsdk.model.payload.IssuesPayload) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Aggregations

GitHubEvent (com.meisolsson.githubsdk.model.GitHubEvent)43 Test (org.junit.Test)18 UiThreadTest (android.test.UiThreadTest)15 Repository (com.meisolsson.githubsdk.model.Repository)9 User (com.meisolsson.githubsdk.model.User)8 IssuesPayload (com.meisolsson.githubsdk.model.payload.IssuesPayload)8 Issue (com.meisolsson.githubsdk.model.Issue)6 CreatePayload (com.meisolsson.githubsdk.model.payload.CreatePayload)5 FollowPayload (com.meisolsson.githubsdk.model.payload.FollowPayload)5 IssueCommentPayload (com.meisolsson.githubsdk.model.payload.IssueCommentPayload)5 PullRequestPayload (com.meisolsson.githubsdk.model.payload.PullRequestPayload)5 PushPayload (com.meisolsson.githubsdk.model.payload.PushPayload)5 CommitCommentPayload (com.meisolsson.githubsdk.model.payload.CommitCommentPayload)4 DownloadPayload (com.meisolsson.githubsdk.model.payload.DownloadPayload)4 ForkPayload (com.meisolsson.githubsdk.model.payload.ForkPayload)4 GistPayload (com.meisolsson.githubsdk.model.payload.GistPayload)4 GollumPayload (com.meisolsson.githubsdk.model.payload.GollumPayload)4 ReleasePayload (com.meisolsson.githubsdk.model.payload.ReleasePayload)4 List (java.util.List)4 View (android.view.View)3