示例#1
0
 public HomeController(
     ILogger <HomeController> logger,
     DashboardStructureLoader structureLoader,
     DashboardDataLoader dataLoader
     )
 {
     this.logger          = logger;
     this.structureLoader = structureLoader;
     this.dataLoader      = dataLoader;
 }
        public void LoadFromFileTest()
        {
            var hostingEnvMoq = new Mock <IHostEnvironment>();

            hostingEnvMoq.SetupGet(env => env.ContentRootPath)
            .Returns(StoragePath);

            var storageConfSvc = new StorageConfig(hostingEnvMoq.Object);
            var panelLoader    = new DashboardStructureLoader(storageConfSvc);

            var layout    = panelLoader.LoadFromFile(DefaultPanelName);
            var firstPage = layout.Pages[0];

            Assert.NotNull(firstPage.Sections);
            Assert.NotNull(firstPage.Sections[0].Indicators);
        }