Example #1
0
        public void DeleteOwner_NonExistingId_ThrowsNullReferenceException()
        {
            Mock <IOwnerRepository> ownerRepository = new Mock <IOwnerRepository>();
            OwnerService            ownerService    = new OwnerService(ownerRepository.Object);

            Action actual = () => ownerService.Delete(1);

            Assert.Throws <NullReferenceException>(actual);
        }
Example #2
0
        public ActionResult Delete(int id)
        {
            var model = Service.Delete(id);

            return(null);
        }
        public async Task <ActionResult> DeleteConfirm(Guid id)
        {
            await ownerService.Delete(id);

            return(RedirectToAction("Index"));
        }