public void FavoritesRepoCheck() { CleanUpDatabase(); _db = CreateDBInstance(); _db.Init(); var record = new FavoritesStreamReference() { TableName = "folder_refs", id = new Identifier(1) }; var repo = FavoritesRepository.Create(_db); var recordKey = repo.CreateKey(); recordKey["id"] = record.id; recordKey["TableName"] = record.TableName; var found = repo.FindByKey(recordKey); Assert.IsTrue(found.Equals(default(FavoritesStreamReference))); repo.Write(record); found = repo.FindByKey(recordKey); Assert.IsTrue(found.Equals(record)); repo.Remove(recordKey); found = repo.FindByKey(recordKey); Assert.IsTrue(found.Equals(default(FavoritesStreamReference))); CleanUpDatabase(); }
public void FavoritesRepoCheck() { CleanUpDatabase(); _db = CreateDBInstance(); _db.Init(); var record = new FavoritesStreamReference() { TableName = "folder_refs", id = new Identifier(1) }; var repo = FavoritesRepository.Create(_db); var recordKey = repo.CreateKey(); recordKey["id"] = record.id; recordKey["TableName"] = record.TableName; var found = repo.FindByKey(recordKey); Assert.IsTrue(found.Equals(default(FavoritesStreamReference))); repo.Write(record); found = repo.FindByKey(recordKey); Assert.IsTrue(found.Equals(record)); repo.Remove(recordKey); found = repo.FindByKey(recordKey); Assert.IsTrue(found.Equals(default(FavoritesStreamReference))); CleanUpDatabase(); }