public void When_create_campaign_and_delete_campaign_By_id() { var campaign = new Campaign() { Id = 123123 }; repoMock .Setup(r => r.Get(It.IsAny <int>())) .Returns(campaign); repoMock .Setup(r => r.Delete(It.IsAny <Campaign>())); campaignList.DeleteById(123123); repoMock.Verify(r => r.Delete(It.IsAny <Campaign>()), Times.Once); }
public IActionResult Delete(int id) { campaignList.DeleteById(id); return(RedirectToAction("Index")); }