public void ProxyForCharReturnType() { LogInvocationInterceptor logger = new LogInvocationInterceptor(); object proxy = generator.CreateClassProxy(typeof(ClassWithCharRetType), logger); Assert.IsNotNull(proxy); Assert.AreEqual('c', ClassWithCharRetType.DoSomething()); }
public void ProducesInvocationsThatCantChangeTarget() { AssertCannotChangeTargetInterceptor invocationChecker = new AssertCannotChangeTargetInterceptor(); object proxy = generator.CreateClassProxy(typeof(ClassWithCharRetType), invocationChecker); Assert.IsNotNull(proxy); var x = ClassWithCharRetType.DoSomething(); Assert.AreEqual('c', x); }