Beispiel #1
0
        public void CanRemoveItemFromIndex()
        {
            CreateIndex(1);

            using (SearchEngineService ses = SearchEngineService.GetByCloset(1))
            {
                int totalEntry = ses.GetTotalIndexedEntryCount();
                ses.RemovePost(2);
                Assert.IsTrue(ses.GetTotalIndexedEntryCount() == totalEntry - 1);
            }
        }
Beispiel #2
0
        public ActionResult RemoveOutfitFromCloset(int outfitSelected)
        {
            ClosetOutfit outfit = closetOutfitRepository.Get(outfitSelected);

            outfit.SendToColdStorage();
            closetOutfitRepository.SaveOrUpdate(outfit);

            if (outfit.Closet.FavoriteOutfit == outfit)
            {
                outfit.Closet.ClearFavoriteOutfit();
            }
            closetRepository.SaveOrUpdate(outfit.Closet);

            using (SearchEngineService ses = SearchEngineService.GetByCloset(ClosetId))
            {
                ses.RemovePost(outfitSelected);
            }

            return(Json(new { Success = true }));
        }
        public void SearchEngineService_DeletesEntry()
        {
            _service.AddPost(new SearchEngineEntry()
            {
                EntryId     = 1,
                Body        = "This is a sample post",
                Title       = "This is the title",
                Tags        = "Title",
                BlogName    = "MyTestBlog",
                IsPublished = true,
                PublishDate = DateTime.Now,
                EntryName   = "this-is-the-title"
            }
                             );

            _service.RemovePost(1);

            var result = _service.Search("sample", 100, 0) as List <SearchEngineResult>;

            Assert.AreEqual(0, result.Count);
        }