public void CreateProxyFromInterfaceWithNonInterceptedMethodTest() { // Arrange var invocationHandler = new CountingInvocationHandler(); // Act var proxy = _proxyFactory.CreateProxy<INonIntercepted>(Type.EmptyTypes, invocationHandler); proxy.Method(); // Assert Assert.That(invocationHandler.InvocationCount, Is.EqualTo(1)); }
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 CreateProxyFromClassWithNonInterceptedEventTest() { // Arrange var invocationHandler = new CountingInvocationHandler(); // Act var proxy = _proxyFactory.CreateProxy<NonIntercepted>(Type.EmptyTypes, invocationHandler); proxy.Event += () => { }; // Assert Assert.That(invocationHandler.InvocationCount, Is.EqualTo(0)); }