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);
        }
Beispiel #2
0
        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);
        }