public void CreateProxyFromAbstractClassWithNonInterceptedPropertyTest() { // Arrange var invocationHandler = new CountingInvocationHandler(); // Act var proxy = _proxyFactory.CreateProxy<NonInterceptedBase>(Type.EmptyTypes, invocationHandler); proxy.Property = default(int); // Assert Assert.That(invocationHandler.InvocationCount, Is.EqualTo(1)); }
public void CreateProxyFromClassWithNonInterceptedMethodTest() { // Arrange var invocationHandler = new CountingInvocationHandler(); // Act var proxy = _proxyFactory.CreateProxy<NonIntercepted>(Type.EmptyTypes, invocationHandler); proxy.Method(); // Assert Assert.That(invocationHandler.InvocationCount, Is.EqualTo(0)); }
public void CreateProxyFromInterfaceWithNonInterceptedEventTest() { // Arrange var invocationHandler = new CountingInvocationHandler(); // Act var proxy = _proxyFactory.CreateProxy<INonIntercepted>(Type.EmptyTypes, invocationHandler); proxy.Event += () => { }; // Assert Assert.That(invocationHandler.InvocationCount, Is.EqualTo(1)); }