Пример #1
0
        public void ByTest12()
        {
            var value  = new Test12();
            var values = new Test12[] { value };
            var expect = (Test12[])value.To(typeof(Test12[]));

            Assert.True(values.SequenceEqual(expect));
        }
Пример #2
0
        public void ByTest12()
        {
            var value  = new Test12();
            var values = new Test12[] { value };
            var expect = value.To <Test12[]>();

            Assert.True(values.SequenceEqual(expect));
        }
Пример #3
0
        public void ByDerived()
        {
            var value = new Test12()
            {
                Property11 = 2,
                Property12 = 4
            };
            var result = value.To <Test11>();
            var expect = new Test11()
            {
                Property11 = 2
            };

            Assert.True(expect.Equals(result));
        }
Пример #4
0
        public void BySelf()
        {
            var value = new Test12()
            {
                Property11 = 2,
                Property12 = 4
            };
            var result = value.To <Test12>();
            var expect = new Test12()
            {
                Property11 = 2,
                Property12 = 4
            };

            Assert.True(result.Equals(expect));
        }