Beispiel #1
0
        public void Ctor_WhenInterceptorIsNotNull_ThenReturnDynamicProxyInterceptorAdapter()
        {
            var interceptorMock = new Mock <IInterceptronInterceptor>();

            var dynamicProxyInterceptorAdapter = new DynamicProxyInterceptorAdapter(interceptorMock.Object);

            Assert.NotNull(dynamicProxyInterceptorAdapter);
        }
Beispiel #2
0
        public void Intercept()
        {
            var interceptorMock = new Mock <IInterceptronInterceptor>();
            var invocationMock  = new Mock <Castle.DynamicProxy.IInvocation>();

            var dynamicProxyInterceptorAdapter = new DynamicProxyInterceptorAdapter(interceptorMock.Object);

            dynamicProxyInterceptorAdapter.Intercept(invocationMock.Object);
            interceptorMock.Verify(i => i.Intercept(invocationMock.Object), Times.Once);
        }