Exemplo n.º 1
0
        public NMockitoInstance()
        {
            Instance = this;

            proxyGenerator = new ProxyGenerator();
            invocationDescriptorFactory = new InvocationDescriptorFactory();
            IReadOnlyList <InvocationTransformation> transformations = new InvocationTransformation[] {
                new OutEnablingInvocationTransformationImpl(),
                new UnwrapParamsInvocationTransformationImpl(),
                new CreateImplicitEqualitySmartParametersInvocationTransformationImpl()
            };

            invocationTransformer = new InvocationTransformer(transformations);
            var verificationInvocationsContainer = new VerificationInvocationsContainer();

            invocationStage = new InvocationStage(verificationInvocationsContainer);
            invocationOperationManagerFinder = new InvocationOperationManagerFinder();
            mockFactory            = new MockFactoryImpl(proxyGenerator, invocationDescriptorFactory, invocationTransformer, invocationStage, invocationOperationManagerFinder);
            smartParameterStore    = new SmartParameterStore();
            smartParameterPusher   = new SmartParameterPusher(smartParameterStore);
            assertionsProxy        = new AssertionsProxy();
            expectationFactory     = new ExpectationFactory(invocationStage, invocationOperationManagerFinder, verificationInvocationsContainer);
            verificationOperations = new VerificationOperations(invocationStage, verificationInvocationsContainer);
            ExceptionCaptorFactory exceptionCaptorFactory = new ExceptionCaptorFactory(proxyGenerator);

            fluentExceptionAssertor = new FluentExceptionAssertor(exceptionCaptorFactory);
            VerificationMockFactory verificationMockFactory = new VerificationMockFactory(proxyGenerator);

            verificationOperationsProxy = new VerificationOperationsProxy(invocationStage, verificationOperations, verificationMockFactory);
            placeholderFactory          = new PlaceholderFactory(mockFactory);
        }
Exemplo n.º 2
0
 public InvocationStage(VerificationInvocationsContainer verificationInvocationsContainer)
 {
     this.verificationInvocationsContainer = verificationInvocationsContainer;
 }
Exemplo n.º 3
0
 public ExpectationFactory(InvocationStage invocationStage, InvocationOperationManagerFinder invocationOperationManagerFinder, VerificationInvocationsContainer verificationInvocationsContainer)
 {
     this.invocationStage = invocationStage;
     this.invocationOperationManagerFinder = invocationOperationManagerFinder;
     this.verificationInvocationsContainer = verificationInvocationsContainer;
 }