예제 #1
0
        public void ReadForDefaultName()
        {
            var systemSettings = new XmlSystemSettings("ExtConfigure");
            var appSettings    = systemSettings.ToAppSettings();
            var cfg            = appSettings.First <MyXmlConfig>();

            Assert.AreEqual("attr field text", cfg.AttrField);
            Assert.AreEqual("elem field text", cfg.ElemField);
        }
예제 #2
0
        private static IAppSettings loadSettings(IContext ctx)
        {
            var systemSettings = new XmlSystemSettings("ExtConfigure", AppDir.Executable.Parent().Value);
            var settingsLoader = new SettingsLoader();

            settingsLoader.XmlFileByExtension();
            var settings = settingsLoader.LoadSettings(systemSettings).Joined.ToAppSettings();

            return(settings);
        }
예제 #3
0
        private static IAppSettings loadSettings()
        {
            var systemSettings = new XmlSystemSettings(@"ExtConfigure");

            var settingsLoader = new SettingsLoader();

            settingsLoader.XmlFileByExtension();
            var settings = settingsLoader.LoadSettings(systemSettings).Joined.ToAppSettings();

            return(settings);
        }
예제 #4
0
        public void IncludeByRelativePath()
        {
            var loader = new SettingsLoader();

            loader.XmlFileByExtension();
            var systemSettings = new XmlSystemSettings("ExtConfigure");
            var settings       = loader.LoadSettings(systemSettings).Joined.ToAppSettings();

            var cfg = settings.Get <MyXmlConfig>("MyCfg2");

            Assert.AreEqual("2", cfg.AttrField);
            Assert.IsNull(cfg.ElemField);
        }
예제 #5
0
        public void IncludeByFixedPathOwner()
        {
            var localPath      = "".ResolveTestPath();
            var systemSettings = new XmlSystemSettings("ExtConfigure", localPath);             // fix for R# test runner

            var loader = new SettingsLoader();

            loader.XmlFileByExtension();
            var settings = loader.LoadSettings(systemSettings).Joined.ToAppSettings();

            var cfg = settings.Get <MyXmlConfig>("MyCfg2");

            Assert.AreEqual("2", cfg.AttrField);
            Assert.IsNull(cfg.ElemField);
        }