Example #1
0
        public static SubstituteState Create(ISubstitutionContext substitutionContext)
        {
            var substituteFactory = substitutionContext.SubstituteFactory;
            var callInfoFactory = new CallInfoFactory();
            var callStack = new CallStack();
            var pendingSpecification = new PendingSpecification();
            var callResults = new CallResults(callInfoFactory);
            var callSpecificationFactory = NewCallSpecificationFactory();
            var callActions = new CallActions(callInfoFactory);

            var callFormatter = new CallFormatter(new ArgumentsFormatter(new ArgumentFormatter()), new ArgumentFormatInfoFactory());

            var state = new object[]
            {
                callInfoFactory,
                callStack,
                pendingSpecification,
                callResults,
                callSpecificationFactory,
                substituteFactory,
                callActions,
                new PropertyHelper(),
                new ResultSetter(callStack, pendingSpecification, callResults, callSpecificationFactory, callActions),
                new EventHandlerRegistry(),
                new ReceivedCallsExceptionThrower(callFormatter),
                new DefaultForType(),
                new IAutoValueProvider[] { new AutoSubstituteProvider(substituteFactory), new AutoStringProvider(), new AutoArrayProvider()}
            };

            return new SubstituteState(state);
        }
Example #2
0
        public static SubstituteState Create(ISubstitutionContext substitutionContext)
        {
            var substituteFactory        = substitutionContext.SubstituteFactory;
            var callInfoFactory          = new CallInfoFactory();
            var callStack                = new CallStack();
            var pendingSpecification     = new PendingSpecification();
            var callResults              = new CallResults(callInfoFactory);
            var callSpecificationFactory = NewCallSpecificationFactory();
            var callActions              = new CallActions(callInfoFactory);

            var callFormatter = new CallFormatter();

            var state = new object[]
            {
                callInfoFactory,
                callStack,
                pendingSpecification,
                callResults,
                callSpecificationFactory,
                substituteFactory,
                callActions,
                new PropertyHelper(),
                new ResultSetter(callStack, pendingSpecification, callResults, callSpecificationFactory, callActions),
                new EventHandlerRegistry(),
                new ReceivedCallsExceptionThrower(),
                new DefaultForType(),
                new IAutoValueProvider[] { new AutoSubstituteProvider(substituteFactory), new AutoStringProvider(), new AutoArrayProvider() }
            };

            return(new SubstituteState(state));
        }
 public SequenceInOrderAssertion()
 {
     _callFormatter = new CallFormatter();
     _argumentFormatter = new ArgumentFormatter();
 }