Exemplo n.º 1
0
        public void RestoreCustomConfig()
        {
            // Initialize config file
            Configuration =
                G9ConfigManagementSingleton <SampleConfig> .GetInstance(ConfigFileName, new SampleConfig()
            {
                UserName = "******"
            }, false, null, "ini");

            Assert.AreEqual(Configuration.Configuration.UserName, "TEST");
        }
Exemplo n.º 2
0
        public void InitializeConfigWithoutSetName()
        {
            // Initialize config file
            Configuration = G9ConfigManagementSingleton <SampleConfig> .GetInstance();

            // Initialize config
            var sampleConfig = new SampleConfig();

            // Check config file name
            Assert.AreEqual(Configuration.ConfigFileName, nameof(SampleConfig));

            // Check version
            Assert.AreEqual(Configuration.Configuration.ConfigVersion, sampleConfig.ConfigVersion);
        }
Exemplo n.º 3
0
        public void InitializeConfigWithSetCustomName()
        {
            // Initialize config file
            Configuration =
                G9ConfigManagementSingleton <SampleConfig> .GetInstance(ConfigFileName,
                                                                        configExtension : ConfigExtension);

            // Initialize config
            var sampleConfig = new SampleConfig();

            // Check config file name
            Assert.AreEqual(Configuration.ConfigFileName, ConfigFileName);

            // Check version
            Assert.AreEqual(Configuration.Configuration.ConfigVersion, sampleConfig.ConfigVersion);
        }
Exemplo n.º 4
0
        public void RestoreConfig()
        {
            // Initialize config file
            Configuration =
                G9ConfigManagementSingleton <SampleConfig> .GetInstance(ConfigFileName,
                                                                        configExtension : ConfigExtension);

            // Initialize config file
            var config2 = G9ConfigManagementSingleton <SampleConfig> .GetInstance();

            // Check config file name
            Assert.AreEqual(Configuration.ConfigFileName, ConfigFileName);
            // Check config file name
            Assert.AreEqual(config2.ConfigFileName, nameof(SampleConfig));

            // Initialize config
            var sampleConfig = new SampleConfig();

            // Check version
            Assert.AreEqual(Configuration.Configuration.ConfigVersion, sampleConfig.ConfigVersion);
            // Check version
            Assert.AreEqual(config2.Configuration.ConfigVersion, sampleConfig.ConfigVersion);
        }