public void GetString()
        {
            var handWritten = new HandWritten();
            var proxy       = new HandWrittenProxy(handWritten, new InvocationHandler(async invocation =>
            {
                var returnValue = await invocation.Proceed();
                return((string)returnValue + "test");
            }));
            var result = proxy.GetString();

            Assert.AreEqual(HandWritten.GetStringReturnValue + "test", result);
        }
        public void GetStringThrowsExcpetionIfAsync()
        {
            var handWritten = new HandWritten();
            var proxy       = new HandWrittenProxy(handWritten, new InvocationHandler(async invocation =>
            {
                await Task.Delay(1);
                var returnValue = await invocation.Proceed();
                return((string)returnValue + "test");
            }));

            try
            {
                proxy.GetString();
                Assert.Fail("Should have thrown an InvalidAsyncException");
            }
            catch (InvalidAsyncException)
            {
            }
        }