public void GetPropertyValueByName()
        {
            var tc = new MyTestClass
            {
                StringValue = "CCCEEE",
                TestClass   = new MyTestClass
                {
                    StringValue = "internal value"
                }
            };

            ObjectExtensionsFunctions.GetPropertyValueByName <string>(tc, "StringValue").ShouldBe(tc.StringValue);
            ObjectExtensionsFunctions.GetPropertyValueByName <MyTestClass>(tc, "TestClass").ShouldBe(tc.TestClass);
        }
        public void GetPropertyValueByName_ThrowsOnNotExists()
        {
            var tc = new MyTestClass
            {
                StringValue = "CCCEEE",
                TestClass   = new MyTestClass
                {
                    StringValue = "internal value"
                }
            };

            Should.Throw <InvalidOperationException>(() => ObjectExtensionsFunctions.GetPropertyValueByName <string>(tc, "VVV"));
            Should.Throw <InvalidOperationException>(() => ObjectExtensionsFunctions.GetPropertyValueByName <MyTestClass>(tc, "testClass"));
        }
        public void GetPropertyValueOrDefaultByName_ReturnsDefault()
        {
            var tc = new MyTestClass
            {
                StringValue = "CCCEEE",
                TestClass   = new MyTestClass
                {
                    StringValue = "internal value"
                }
            };

            ObjectExtensionsFunctions.GetPropertyValueOrDefaultByName <string>(tc, "VVV").ShouldBe(default(string));
            ObjectExtensionsFunctions.GetPropertyValueOrDefaultByName <MyTestClass>(tc, "testClass").ShouldBe(default(MyTestClass));
        }
        public void DeepClone()
        {
            var src = new MyTestClass
            {
                StringValue = "some string",
                TestClass   = new MyTestClass
                {
                    StringValue = "inneer string",
                }
            };

            var dest = src.DeepClone();

            dest.StringValue.ShouldBe(src.StringValue);
            dest.TestClass.StringValue.ShouldBe(src.TestClass.StringValue);
            dest.TestClass.GetHashCode().ShouldNotBe(src.TestClass.GetHashCode());
        }