public ActionResult Remove(string courseId) { string userId = this.User.Claims.FirstOrDefault(i => i.Type == "userid").Value; subscriptionsService.Delete(userId, courseId); return(new StatusCodeResult(200)); }
public void SubscriptionsService_Delete_calls_Delete_method() { int id = 14; bool isDeleteCalled = false; var mock = new Mock <IUnitOfWork>(); mock.Setup(a => a.Subscriptions.Delete(id)).Callback(() => isDeleteCalled = true); service = new SubscriptionsService(mock.Object); service.Delete(id); Assert.IsTrue(isDeleteCalled); }