Пример #1
0
        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);
        }
Пример #2
0
 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));
 }