Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public ActionResult Delete(int id)
        {
            var model = Service.Delete(id);

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

            return(RedirectToAction("Index"));
        }