예제 #1
0
        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);
        }
예제 #2
0
 public IActionResult Delete(int id)
 {
     campaignList.DeleteById(id);
     return(RedirectToAction("Index"));
 }