public void RestoreCustomConfig() { // Initialize config file Configuration = G9ConfigManagementSingleton <SampleConfig> .GetInstance(ConfigFileName, new SampleConfig() { UserName = "******" }, false, null, "ini"); Assert.AreEqual(Configuration.Configuration.UserName, "TEST"); }
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); }
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); }
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); }