public void When_updating_campaign_Update_does_campaign_Update() { var testCampaign = new Campaign(); repoMock .Setup(r => r.Update(testCampaign)); campaignList.Update(testCampaign); //Assert repoMock.Verify(r => r.Update(testCampaign), Times.Once); }
public ActionResult CreateEdit(Campaign campaign) { if (ModelState.IsValid) { if (campaign.Id > 0) { campaignList.Update(campaign); } else { campaignList.Add(campaign); } return(RedirectToAction("Index")); } return(View(nameof(CreateEdit), campaign)); }