public StubGenerator(ScenarioInterpreter scenarioInterpreter, ImplementationHelper implementationHelper, ITextWriter suggestionWriter, ISessionContext context) { _scenarioInterpreter = scenarioInterpreter; SuggestionWriter = suggestionWriter; _context = context; _implementationHelper = implementationHelper; }
public ScenarioLineExecuter(ScenarioInterpreter scenarioInterpreter, IEventBus eventBus) { _memberInvoker = new MemberInvoker(); _scenarioInterpreter = scenarioInterpreter; _eventBus = eventBus; }
public InPlaceStoryRunner(ScenarioInterpreter scenarioInterpreter, IStoryFilter filter, ISessionContext context, IEventBus eventBus) : base(filter, context, eventBus) { _scenarioRunner = new InPlaceScenarioRunner(eventBus, scenarioInterpreter); }
public void SetupContext() { FakeEventBus = MockRepository.GenerateStub <IEventBus>(); var scenarioInterpreter = new ScenarioInterpreter(new InterpreterForTypeFactory(new AssemblyRegistry()), MockRepository.GenerateStub <IAmbiguousMatchResolver>(), new DefaultLanguageService()); var inPlaceRunner = new InPlaceStoryRunner(scenarioInterpreter, new IncludeAllFilter(), new SessionContext(), FakeEventBus); inPlaceRunner.Finished(); }
private InPlaceStoryRunner GetRunner() { FakeEventBus = new CapturingEventBus(); var assemblyRegistry = new AssemblyRegistry(new[] { typeof(TestExtensionMethods).Assembly }); var scenarioInterpreter = new ScenarioInterpreter(new InterpreterForTypeFactory(assemblyRegistry), MockRepository.GenerateStub <IAmbiguousMatchResolver>(), new DefaultLanguageService()); return(new InPlaceStoryRunner(scenarioInterpreter, new IncludeAllFilter(), new FakeSessionContext(Context), FakeEventBus)); }
protected DriverBase(IEventBus eventBus) { //ResultListener = resultListener; _eventBus = eventBus; var assemblyRegistry = new AssemblyRegistry(GetAssemblies()); ScenarioInterpreter = new ScenarioInterpreter(new InterpreterForTypeFactory(assemblyRegistry), new MostRecentlyUsedContext(), new DefaultLanguageService()); LineExecuter = new ScenarioLineExecuter(ScenarioInterpreter, _eventBus); _context = new SessionContext(assemblyRegistry); ParameterConverter.AddCustomConverters(assemblyRegistry); }
public void SetupContext() { FakeResolver = MockRepository.GenerateMock <IAmbiguousMatchResolver>(); var factory = new InterpreterForTypeFactory(new AssemblyRegistry()); ChainReturnedFromResolver = new InvocationChain(); FakeResolver.Stub(x => x.ResolveMatch("", null)).IgnoreArguments().Return(ChainReturnedFromResolver); ScenarioInterpreter interpreter = new ScenarioInterpreter(factory, FakeResolver, new DefaultLanguageService()); Result = interpreter.GetChain( new ScenarioContext(new StoryContext(new FakeSessionContext()), new Type[] { typeof(AmbiguousTestClass) }, new Dictionary <Type, object>()), "Foo bar baz"); }
public void SetupContext() { FakeResolver = MockRepository.GenerateMock<IAmbiguousMatchResolver>(); var factory = new InterpreterForTypeFactory(new AssemblyRegistry()); ChainReturnedFromResolver = new InvocationChain(); FakeResolver.Stub(x => x.ResolveMatch("", null)).IgnoreArguments().Return(ChainReturnedFromResolver); ScenarioInterpreter interpreter = new ScenarioInterpreter(factory, FakeResolver, new DefaultLanguageService()); Result = interpreter.GetChain( new ScenarioContext(new StoryContext(new FakeSessionContext()), new Type[] {typeof (AmbiguousTestClass)}, new Dictionary<Type, object>()), "Foo bar baz"); }
public void SetupContext() { FakeWriter = MockRepository.GenerateMock <ITextWriter>(); FakeResolver = MockRepository.GenerateMock <IAmbiguousMatchResolver>(); var scenarioInterpreter = new ScenarioInterpreter(new InterpreterForTypeFactory(new AssemblyRegistry()), FakeResolver, new DefaultLanguageService()); Generator = new StubGenerator(scenarioInterpreter, new ImplementationHelper(), FakeWriter, new FakeSessionContext()); TestStory = new Story("foo", "", new[] { TestHelper.BuildScenario("", new[] { "first line", "second line" }), TestHelper.BuildScenario("", new[] { "first line", "second line", "third line" }), TestHelper.BuildScenario("", new[] { "this line's weird, punctuation! should be: handled" }) }); Generator.HandleStories(new[] { TestStory }); Suggestions = (string)FakeWriter.GetArgumentsForCallsMadeOn(x => x.Write(Arg <string> .Is.Anything))[0][0]; }
public InPlaceScenarioRunner(IEventBus eventBus, ScenarioInterpreter scenarioInterpreter) { _eventBus = eventBus; _scenarioInterpreter = scenarioInterpreter; _lineExecuter = new ScenarioLineExecuter(scenarioInterpreter, eventBus); }