예제 #1
0
        public void ConfigBackendSave( )
        {
            TestBackend backend = new TestBackend( );
            ITestConfig conf    = Config.New <ITestConfig>( );

            conf.Backend     = backend;
            conf.StringProp1 = "saved string";
            conf.IntProp     = 12345;
            conf.Save( );
            Assert.AreEqual("saved string", backend.Values["StringProp1"]);
            Assert.AreEqual(12345, backend.Values["IntProp"]);
            Assert.AreEqual(conf.Keys.Count( ), backend.Values.Count);
        }
예제 #2
0
        public void ConfigBackendRead( )
        {
            TestBackend backend = new TestBackend( );

            backend.Values["StringProp1"] = "read string";
            backend.Values["IntProp"]     = 12345;
            ITestConfig conf = Config.New <ITestConfig>( );

            conf.Backend = backend;
            conf.Read( );
            Assert.AreEqual("read string", conf.StringProp1);
            Assert.AreEqual(12345, conf.IntProp);
            Assert.AreEqual("Hello World!", conf.StringProp2);
        }