Ejemplo n.º 1
0
        public void CloneObjects()
        {
            //var a = new { First = 101, Second = 102 };
            //var b = new { First = 201L, Second = 202L };

            if (true)
            {
                var A = new APair <int> {
                    First = RV(), Second = RV()
                }; AssertAreEquals(A, ObjectCloner.CreateMemberwiseClone(A));
            }
            if (true)
            {
                var A = new APair <long> {
                    First = RV(), Second = RV()
                }; AssertAreEquals(A, ObjectCloner.CreateMemberwiseClone(A));
            }
            if (true)
            {
                var A = new APair <float> {
                    First = RV(), Second = RV()
                }; AssertAreEquals(A, ObjectCloner.CreateMemberwiseClone(A));
            }
            if (true)
            {
                var A = new APair <double> {
                    First = RV(), Second = RV()
                }; AssertAreEquals(A, ObjectCloner.CreateMemberwiseClone(A));
            }
            if (true)
            {
                var A = new APair <decimal> {
                    First = RV(), Second = RV()
                }; AssertAreEquals(A, ObjectCloner.CreateMemberwiseClone(A));
            }
            if (true)
            {
                var A = new APair <string> {
                    First = RS(), Second = RS()
                }; AssertAreEquals(A, ObjectCloner.CreateMemberwiseClone(A));
            }
        }