public void When_Get_Then_Result_Is_ListOf_Campaigns() { // Setup var campaigns = new List <Campaign> { new Campaign { Id = 1 }, new Campaign { Id = 2 } }; repoMock .Setup(r => r.Get()) .Returns(campaigns); // Act var campaignsFromDb = campaignList.Get(); // Assert Assert.Equal(campaigns, campaignsFromDb); }
public ActionResult Details(int id) { var campaign = campaignList.Get(id); return(View(new CampaignDetailsViewModel { Campaign = campaign, Projects = projectList.GetProjectsWithVotesCount(id, campaign.EndDateTime) })); }