public void TestRestoreNoSuchFile() { var filePath = "dawlnkn lknklawdnkwad"; var bookmarks = new Tailviewer.Settings.Bookmarks.Bookmarks(filePath); new Action(() => bookmarks.Restore()).Should().NotThrow(); bookmarks.Should().BeEmpty(); }
public void TestRoundtrip() { var filePath = Path.Combine(Path.GetTempPath(), "Tailviewer", "Tests", "bookmarks.xml"); var bookmarks = new Tailviewer.Settings.Bookmarks.Bookmarks(filePath); bookmarks.Add(new BookmarkSettings(DataSourceId.CreateNew(), new LogLineIndex(101))); bookmarks.Save(); var actualBookmarks = new Tailviewer.Settings.Bookmarks.Bookmarks(filePath); actualBookmarks.Restore(); actualBookmarks.Should().HaveCount(1); actualBookmarks[0].DataSourceId.Should().Be(bookmarks[0].DataSourceId); actualBookmarks[0].Index.Should().Be(bookmarks[0].Index); }