Example #1
0
        public void CopyByDestWithError()
        {
            var src = new Dictionary<string, string>();
            src["Age"] = "15";

            Sample.Person p = new Sample.Person();
            src.ShallowCopy(p, CopyOptions.BaseOnDest, true);

            Assert.AreEqual(15, p.Age);
        }
Example #2
0
        public void CopyBySource()
        {
            var src = new Dictionary<string, string>();
            src["Age"] = "15";

            Sample.Person p = new Sample.Person();
            src.ShallowCopy(p, CopyOptions.BaseOnSource, false);

            Assert.AreEqual(15, p.Age);
        }
Example #3
0
        public void CopyByBoth()
        {
            var src = new Dictionary<string, string>();
            src["Name"] = "r";
            src["Age"] = "15";

            Sample.Person p = new Sample.Person();
            src.ShallowCopy(p);

            Assert.AreEqual(15, p.Age);
            Assert.AreEqual("r", p.Name);
        }