Exemplo n.º 1
0
        public void ContinueIfUnableToProxyControllerFactory(ExecutionInspector sut, IInspectorContext context)
        {
            context.ProxyFactory.Setup(f => f.IsWrapClassEligible(It.IsAny <Type>())).Returns(false);

            sut.Setup(context);

            Assert.IsType <DefaultControllerFactory>(ControllerBuilder.Current.GetControllerFactory());
        }
Exemplo n.º 2
0
        public void ProxyControllerFactory(ExecutionInspector sut, IInspectorContext context, IControllerFactory controllerFactory)
        {
            context.ProxyFactory.Setup(f => f.IsWrapInterfaceEligible <IControllerFactory>(It.IsAny <Type>())).Returns(true);
            context.ProxyFactory.Setup(f => f.WrapInterface(It.IsAny <IControllerFactory>(), It.IsAny <IEnumerable <IAlternateMethod> >(), Enumerable.Empty <object>())).Returns(controllerFactory);

            sut.Setup(context);

            Assert.Equal(ControllerBuilder.Current.GetControllerFactory(), controllerFactory);
            context.Logger.Verify(l => l.Debug(It.Is <string>(s => s.Contains("IControllerFactory")), It.IsAny <object[]>()));
        }