public static async Task ComicNameChangePersistsAfterUpdating( [ValueSource(nameof(EnumerateKnownComicTypes))] MockComic comic) { // Initial comic import ComicData savedComic = await comicUpdater.ImportComic(comic.State1.ArchiveUrl); database.Write(realm => savedComic.Name = "New Name"); // Update comic now that selector has been switched IEnumerable <ComicPageData> pages = await comicUpdater.UpdateComic(savedComic); Assert.AreEqual("New Name", savedComic.Name); }
public static void DeletingComicDeletesPages() { var comic = new ComicData(); database.Write(realm => { // Add 1 comic with 1 page realm.Add(comic); var page = new ComicPageData { Comic = comic }; realm.Add(page); }); // Delete comic database.DeleteComic(comic); // Check that page was also deleted (should be no pages in database) var pages = database.Realm.All <ComicPageData>(); var pageCount = pages.Count(); Assert.AreEqual(0, pageCount); }