public void DefaultConfigTest() { var config = new ExtensionYamlConfig <TestPortalConfig> ( Path.GetFullPath("SomeNonExistentConfigFile.yml"), cfg => { return(cfg); } ); Assert.Equal(1, config.GetInstance(0).Key); Assert.Equal("Default value", config.GetInstance(0).Value); }
public void ReadConfigTest() { var config = new ExtensionYamlConfig <TestPortalConfig> ( Path.GetFullPath("../../Configuration/Config.yml"), cfg => { return(cfg); } ); Assert.Equal(10, config.GetInstance(0).Key); Assert.Equal("Value from config", config.GetInstance(0).Value); }
public void DefaultDnnReactConfigTest() { var config = new ExtensionYamlConfig <DnnReactConfig> ( Path.GetFullPath("SomeNonExistentConfigFile.yml"), cfg => { return(cfg); } ); Assert.NotNull(config.GetInstance(0).JavaScriptEngine); Assert.Equal("JurassicJsEngine", config.GetInstance(0).JavaScriptEngine.DefaultEngineName); Assert.Equal(10, config.GetInstance(0).JavaScriptEngine.StartEngines); Assert.Equal(25, config.GetInstance(0).JavaScriptEngine.MaxEngines); Assert.Equal(true, config.GetInstance(0).JavaScriptEngine.ReuseEngines); Assert.Equal(null, config.GetInstance(0).JavaScriptEngine.MaxUsagesPerEngine); Assert.Equal(false, config.GetInstance(0).DisableServerSideRendering); Assert.Equal(false, config.GetInstance(0).Babel.LoadBabel); }
public static UniversityPortalConfig GetInstance(int portalId) { return(_config.GetInstance(portalId)); }