public async System.Threading.Tasks.Task testFeaturesGetAsync() { var features = new List<Features> { new Features() { Id = "test1" }, new Features() { Id = "test2" }, }; var fakeRepositoryMock = new Mock<IFeaturesRepository>(); fakeRepositoryMock.Setup(x => x.GetAll()).ReturnsAsync(features); var featuresService = new FeaturesService(fakeRepositoryMock.Object); var resultFeatures = await featuresService.GetFeatures(); Xunit.Assert.Collection(resultFeatures, features => { Xunit.Assert.Equal("test1", features.Id); }, features => { Xunit.Assert.Equal("test2", features.Id); }); }
// GET: Home public ActionResult Index() { UserContact dynamics = new UserContact(); FeaturesService _featuresService = new FeaturesService(); WorksService _worksService = new WorksService(); BannerService _bannerService = new BannerService(); dynamics.Features = _featuresService.GetFeatures().ToList(); dynamics.Works = _worksService.GetWorks().ToList(); dynamics.Banner = _bannerService.BannerGet(5); TempData["BannerTitle"] = dynamics.Banner.Title; TempData["BannerD"] = dynamics.Banner.Description; return(View(dynamics)); }
public ActionResult FeaturesList() { return(View(_featuresService.GetFeatures())); }