示例#1
0
        public void SaveCatalogMethod()
        {
            LibraryRepository repository = new LibraryRepository();

            Task.Run(() => repository.AddCatalog(Title, Author));
            Messenger.Default.Send <NotificationMessage>(new NotificationMessage("CloseAddCatalog"));
            Messenger.Default.Send <NotificationMessage>(new NotificationMessage("RefreshCatalog"));
        }
示例#2
0
        public void AddAndRemoveCatalogTest()
        {
            int int1 = repository.AddCatalog("Dune", "Frank Herbert");
            int int2 = repository.AddCatalog("Krol", "Szczepan Twardoch");

            Assert.AreEqual(repository.GetAllCatalogIds().Count, 2);
            repository.RemoveCatalog(int1);
            repository.RemoveCatalog(int2);
            Assert.AreEqual(repository.GetAllCatalogIds().Count, 0);
        }