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

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

            return(RedirectToAction("Index"));
        }