Пример #1
0
            private static IHandlerFactory GetHandlerFactory(
                IHandlerFactory handlerFactory,
                IHandler <TestRequest> handler)
            {
                if (handlerFactory.IsNull())
                {
                    handlerFactory = Mock.Of <IHandlerFactory>();
                }

                if (handler.IsNull())
                {
                    handler = GetHandler();
                }

                Mock.Get(handlerFactory)
                .Setup(f => f.GetHandler <TestRequest>())
                .Returns(handler);

                return(handlerFactory);
            }
            private static IHandlerFactory GetHandlerFactory(
                IHandlerFactory handlerFactory, 
                IHandler<TestRequest> handler)
            {
                if (handlerFactory.IsNull())
                    handlerFactory = Mock.Of<IHandlerFactory>();

                if (handler.IsNull())
                    handler = GetHandler();

                Mock.Get(handlerFactory)
                    .Setup(f => f.GetHandler<TestRequest>())
                    .Returns(handler);

                return handlerFactory;
            }