public void DeleteShould_ReturnValue()
        {
            // Arrange
            var  pagesService = new PagesService(pageRepoMock.Object, bookServiceMock.Object, contextMock.Object);
            Page page         = new Page();

            // Arrange
            contextMock.Setup(x => x.Commit()).Returns(1);
            var result = pagesService.Delete(page);

            // Assert
            Assert.IsInstanceOf(typeof(int), result);
        }
Exemple #2
0
        public ActionResult RemovePage(int?id)
        {
            var delete = _pagesService.Get(id.Value);

            if (delete != null)
            {
                _pagesService.Delete(delete.Id);
                _seoService.Delete(delete.UrlId);

                return(this.RedirectToAction("Index", "Home"));
            }

            return(this.HttpResult(HttpStatusCode.NoContent));
        }