use of com.github.pockethub.android.core.issue.IssueStore in project PocketHub by pockethub.
the class IssueStoreTest method testReuseIssue.
/**
* Verify issue is updated when re-added
*/
public void testReuseIssue() {
IssueStore store = new IssueStore(mContext);
Repository repo = InfoUtils.createRepoFromData("owner", "name");
assertNull(store.getIssue(repo, 1));
Issue issue = Issue.builder().repository(repo).number(1).body("body").build();
assertEquals(issue, store.addIssue(issue));
assertEquals(issue, store.getIssue(repo, 1));
Issue issue2 = Issue.builder().repository(repo).number(1).body("body2").build();
assertNotEqual(issue, store.addIssue(issue2));
assertNotEqual(issue2.body(), issue.body());
assertNotEqual(issue, store.getIssue(repo, 1));
}
use of com.github.pockethub.android.core.issue.IssueStore in project PocketHub by pockethub.
the class PocketHubModule method issueStore.
@Provides
IssueStore issueStore(Context context) {
IssueStore store = issues != null ? issues.get() : null;
if (store == null) {
store = new IssueStore(context);
issues = new WeakReference<>(store);
}
return store;
}
Aggregations