コード例 #1
0
ファイル: BeanTests.cs プロジェクト: edgarborja/LimeBean
        public void Import()
        {
            var bean = new Bean();
            bean["a"] = 1;
            bean["b"] = 1;
            bean["c"] = 1;

            var data = new Dictionary<string, object> { { "b", 2 }, { "c", null } };
            bean.Import(data);

            Assert.Equal(1, bean["a"]);
            Assert.Equal(2, bean["b"]);
            Assert.Equal(null, bean["c"]);

            data["b"] = "changed";
            Assert.Equal(2, bean["b"]);
        }
コード例 #2
0
        public void Import()
        {
            var bean = new Bean();

            bean["a"] = 1;
            bean["b"] = 1;
            bean["c"] = 1;

            var data = new Dictionary <string, object> {
                { "b", 2 }, { "c", null }
            };

            bean.Import(data);

            Assert.Equal(1, bean["a"]);
            Assert.Equal(2, bean["b"]);
            Assert.Equal(null, bean["c"]);

            data["b"] = "changed";
            Assert.Equal(2, bean["b"]);
        }