public void Delete_entry() { var syncTable = new List<SyncTableEntry> {new SyncTableEntry{RelativeFilename = "myfn"}}; var sut = new RemoteSyncTable(REPO_PATH, syncTable); var rf = new RepoFile {RelativeFileName = "myfn"}; var result = sut.DeleteEntry(rf); Equalidator.AreEqual(result, rf); Assert.AreEqual(0, syncTable.Count); }
public void Persist_sync_table_after_delete() { var sut = new RemoteSyncTable(REPO_PATH, new List<SyncTableEntry>()); sut.AddEntry(new RepoFile { Id = "myid", User = "******", TimeStamp = new DateTime(2000, 5, 12), RelativeFileName = "myfn" }); sut.AddEntry(new RepoFile { Id = "yourid", User = "******", TimeStamp = new DateTime(2001, 3, 26), RelativeFileName = "yourfn" }); sut.DeleteEntry(new RepoFile {RelativeFileName = "yourfn"}); Assert.AreEqual("myfn\tmyid\tmyuser\t2000-05-12T00:00:00\r\n", File.ReadAllText(REPO_PATH + @"\.sync")); }