Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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);
        }