public void TestMethodThrowError()
        {
            var real = new ErrorProneForProxy();
            dynamic proxy = new DynamicProxy(real);
            int data = proxy.DoWorkNonError(15);
            Assert.IsTrue(data == 20);

            proxy.DefaultData = 15;
            data = proxy.DoWorkNonError(15);
            Assert.IsTrue(data == 30);

            data = proxy.DoWorkReturnError(15);
            Assert.IsTrue(data == 20);
        }
        public void TestMethodDoNotThrowError()
        {
            var real = new ErrorProneForProxy();
            dynamic proxy = new DynamicProxy(real);
            int data = proxy.DoWorkNonError(15);
            Assert.IsTrue(data == 20);

            proxy.DefaultData = 15;
            data = proxy.DoWorkNonError(15);
            Assert.IsTrue(data == 30);

            data = -1;
            data = proxy.DoWorkErrorNoThrow(15);
            //Since method above in case on error will eat exception
            //it must return default value as a result
            Assert.IsTrue(data == 0);
        }