public async Task Opens_existing_database(CachedIssue issue) { var databaseFile = "file2.db"; if (File.Exists(databaseFile)) { File.Delete(databaseFile); } using (var repo = new SqliteJiraLocalCacheRepository(databaseFile)) { await repo.Initialize(); await repo.AddOrReplaceCachedIssue(issue); } using (var repo = new SqliteJiraLocalCacheRepository(databaseFile)) { await repo.Initialize(); var retrievedIssue = (await repo.GetIssues()).SingleOrDefault(); issue.ShouldCompare(retrievedIssue); } }
public async Task Repository_saves_whole_issue(CachedIssue issue) { await Repository.Initialize(); await Repository.AddOrReplaceCachedIssue(issue); var retrievedIssue = (await Repository.GetIssues()).SingleOrDefault(); issue.ShouldCompare(retrievedIssue); }