Search in sources :

Example 16 with Commit

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

the class FullCommitTest method testSingleLineCommentSingleFile.

/**
     * Test commit with one file and one line comment
     */
public void testSingleLineCommentSingleFile() {
    GitHubFile file = GitHubFile.builder().filename("a.txt").build();
    GitComment comment = GitComment.builder().path(file.filename()).position(10).build();
    Commit commit = Commit.builder().files(Collections.singletonList(file)).build();
    FullCommit full = new FullCommit(commit, new ArrayList<>(Collections.singletonList(comment)));
    assertTrue(full.isEmpty());
    assertEquals(1, full.getFiles().size());
    assertEquals(comment, full.getFiles().get(0).get(10).get(0));
}
Also used : Commit(com.meisolsson.githubsdk.model.Commit) FullCommit(com.github.pockethub.android.core.commit.FullCommit) GitHubFile(com.meisolsson.githubsdk.model.GitHubFile) FullCommit(com.github.pockethub.android.core.commit.FullCommit) GitComment(com.meisolsson.githubsdk.model.git.GitComment)

Aggregations

Commit (com.meisolsson.githubsdk.model.Commit)16 GitCommit (com.meisolsson.githubsdk.model.git.GitCommit)7 FullCommit (com.github.pockethub.android.core.commit.FullCommit)6 GitHubFile (com.meisolsson.githubsdk.model.GitHubFile)5 GitComment (com.meisolsson.githubsdk.model.git.GitComment)5 GitUser (com.meisolsson.githubsdk.model.git.GitUser)4 View (android.view.View)2 AdapterView (android.widget.AdapterView)2 ListView (android.widget.ListView)2 TextView (android.widget.TextView)2 Date (java.util.Date)2 LayoutInflater (android.view.LayoutInflater)1 ImageView (android.widget.ImageView)1 StyledText (com.github.pockethub.android.ui.StyledText)1 RepositoryCommentService (com.meisolsson.githubsdk.service.repositories.RepositoryCommentService)1 IOException (java.io.IOException)1