Beispiel #1
0
        public void RetrieveConfig()
        {
            FakeConfig Config          = new FakeConfig();
            FakeConfig RetrievedConfig = ConfigMapper.Get <FakeConfig>();

            if (Config.Test == RetrievedConfig.Test)
            {
                Assert.Fail();
            }
        }
        public void TestPresistance()
        {
            FakeConfig Config = ConfigMapper.Get <FakeConfig>(false);

            Assert.IsFalse(ConfigMapper.Configs.ContainsKey(Config.GetType()), "Presistance avoidance failed");

            Config = (FakeConfig)ConfigMapper.Get(typeof(FakeConfig), false);

            Assert.IsFalse(ConfigMapper.Configs.ContainsKey(Config.GetType()), "Presistance avoidance failed");

            Config = ConfigMapper.Get <FakeConfig>();

            Assert.IsTrue(ConfigMapper.Configs.ContainsKey(Config.GetType()), "Presistance failed");
        }
 /// <summary>Creates a new instance of <see cref="Storage"/></summary>
 static Storage()
 {
     Storage.Config = ConfigMapper.Get <StorageConfig>();
 }
Beispiel #4
0
 /// <summary>Creates a new instance of <see cref="BaseConfig{ConfigType}"/></summary>
 public BaseConfig()
 {
     this.Config = ConfigMapper.Get <ConfigType>();
 }