Exemplo n.º 1
0
        public void TestCompositeDictionary()
        {
            DictionaryTestEntity obj = new DictionaryTestEntity
            {
                Foo   = "bar",
                Stuff =
                {
                    { "abc", CompositeType.Create(123)            },
                    { "def", CompositeType.Create(DateTime.Today) },
                    { "ghi", CompositeType.Create("hello world")  },
                }
            }, clone = Serializer.DeepClone(obj);

            Assert.IsNotNull(clone);
            Assert.AreNotSame(clone, obj);
            Assert.AreEqual("bar", clone.Foo);
            Assert.AreEqual(3, clone.Stuff.Count);
            Assert.AreEqual(123, clone.Stuff["abc"].Value);
            Assert.AreEqual(DateTime.Today, clone.Stuff["def"].Value);
            Assert.AreEqual("hello world", clone.Stuff["ghi"].Value);
        }