Ejemplo n.º 1
0
        public void Clone()
        {
            Orders order = new Orders();
            order.Customer_ID = "999999";
            order.Freight = new decimal(10.0);
            order.Order_Date = DateTime.Now;

             Orders copy =  Reflections.Clone<Orders>()(order);

             Assert.IsTrue(order.Order_Date==copy.Order_Date);
             Assert.IsFalse(order.GetHashCode() == copy.GetHashCode());
        }
Ejemplo n.º 2
0
        public void CopyPropertiesFunc()
        {
            Orders order = new Orders();
            order.Customer_ID = "999999";
            order.Freight = new decimal(10.0);
            order.Order_Date = DateTime.Now;

            Orders order1 = new Orders();

            Reflections.CopyPropertiesFunc1<Orders, Orders>()(order, order1);
            Assert.IsTrue(order1.Customer_ID == order.Customer_ID);

            order1 = new Orders();
            Reflections.CopyPropertiesFunc<Orders, Orders>()(order, order1);
            Assert.IsTrue(order1.Customer_ID == order.Customer_ID);
        }