public void TestJSONFileRepoQuerying() { JsonFileRepo repo = new JsonFileRepo(PATH); Note note = new Note("1", "234"); repo.Save(note); Assert.AreEqual(note.Title, repo.GetAll()[0].Title); }
public void TestCorrectJsonRepoIndex() { JsonFileRepo repo = new JsonFileRepo(PATH); Note note = new Note("bataie", "1234"); repo.Save(note); Assert.AreEqual(1, repo.Size()); }
public void TestCaching() { string path = TestFileIO.FILE_PATH; JsonFileRepo repo = new JsonFileRepo(path); repo.Save(new Note("1", "234")); DateTime lastModified = System.IO.File.GetLastWriteTime(path); repo.GetAll(); List<Note> cached = repo.CacheMap[lastModified]; Assert.IsNotNull(cached); }
public void TestJsonFileRepositoryCycle() { JsonFileRepo jsonFileRepo = new JsonFileRepo(TestFileIO.FILE_PATH); testSpecificRepo(jsonFileRepo); }