Пример #1
0
        public void TestDeleteMustCallRepository()
        {
            var deleteId = Guid.NewGuid();

            target.Delete(deleteId);

            _subscriptionRepositoryMock.Verify(m => m.Delete(It.IsAny <Guid>()), Times.Once);
        }
Пример #2
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         Db db = new Db(DbServices.ConnectionString);
         SubscriptionServices.Delete(CurrentUser.Id, id, db);
         TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "DeleteConfirmed");
         // return RedirectToAction("Index");
     }
     catch (CfException cfex)
     {
         TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
     }
     catch (Exception ex)
     {
         TempData["Failure"] = ex.Message;
     }
     // return View(subscription);
     return(RedirectToAction("Index"));
 }