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>(); Generator = new StubGenerator(new ScenarioInterpreter(new InterpreterForTypeFactory(new ExtensionMethodHandler(new AssemblyRegistry())), FakeResolver), 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.HandleStory(TestStory); Generator.Finished(); Suggestions = (string) FakeWriter.GetArgumentsForCallsMadeOn(x => x.Write(Arg<string>.Is.Anything))[0][0]; }
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 ScenarioInterpreter(IInterpreterForTypeFactory interpreterFactory, IAmbiguousMatchResolver resolver, ILanguageService languageService ) { _interpreterFactory = interpreterFactory; _resolver = resolver; _languageService = languageService; }
private IStoryHandler BuildInPlaceRunner(IAmbiguousMatchResolver resolver) { var sameDomainHandlerFactory = new SameDomainHandlerFactory(new AssemblyGenerator(), _assemblyRegistry,new Filesystem()); return new InPlaceCompilingStoryRunner(sameDomainHandlerFactory, new IncludeAllFilter(), _eventBus); }
public ScenarioInterpreter(IInterpreterForTypeFactory interpreterFactory, IAmbiguousMatchResolver resolver, ILanguageService languageService) { _interpreterFactory = interpreterFactory; _resolver = resolver; _languageService = languageService; }
private IStoryHandler BuildInPlaceRunner(IAmbiguousMatchResolver resolver) { IScenarioPreprocessor preprocessor = new ScenarioPreprocessor(); var sameDomainHandlerFactory = new SameDomainHandlerFactory(new AssemblyGenerator(), _assemblyRegistry,new Filesystem()); return new InPlaceCompilingStoryRunner(sameDomainHandlerFactory, preprocessor, new IncludeAllFilter(), _sessionContext, _eventBus); }
private IStoryHandler BuildInPlaceRunner(IAmbiguousMatchResolver resolver) { IScenarioPreprocessor preprocessor = new ScenarioPreprocessor(); //var interpreterForTypeFactory = new InterpreterForTypeFactory(new ExtensionMethodHandler(_assemblyRegistry)); //var scenarioInterpreter = new ScenarioInterpreter(interpreterForTypeFactory, resolver); //return new InPlaceStoryRunner(preprocessor, scenarioInterpreter, new IncludeAllFilter(), _sessionContext, _eventBus ); return new InPlaceCompilingStoryRunner(new RemoteHandlerFactory(new AssemblyGenerator(), _assemblyRegistry, new Filesystem()), preprocessor, new IncludeAllFilter(), _sessionContext, _eventBus); }
private IStoryHandler BuildInPlaceRunner(IAmbiguousMatchResolver resolver) { var sameDomainHandlerFactory = new SameDomainHandlerFactory(new AssemblyGenerator(), _assemblyRegistry,new Filesystem()); return new InPlaceCompilingStoryRunner(sameDomainHandlerFactory, new IncludeAllFilter(), _eventBus); }