public void Delete_DeletesStoreObject_True()
        {
            _store.Save();
            ActionResult deletePost = _controller.Delete(_store.GetId());

            Assert.IsInstanceOfType(deletePost, typeof(ActionResult));
            CollectionAssert.AreEqual(new List <Store> {
            }, Store.GetAll());
        }
示例#2
0
        public async Task DeleteStoreWhichDoesntExistInDatabase_ReturnNotFoundScreen()
        {
            var bookRepo  = new FakeBookRepository();
            var pubRepo   = new FakePublisherRepository();
            var storeRepo = new FakeStoreRepository();

            var controller = new StoresController(bookRepo, pubRepo, storeRepo);

            var result = await controller.Delete(1) as ViewResult;

            Assert.AreEqual("NotFound", result.ViewName);
        }