protected DriverBase(IResultListener listener) { _listener = listener; ScenarioInterpreter = new ScenarioInterpreter(new InterpreterForTypeFactory(new ExtensionMethodHandler())); LineExecuter = new ScenarioLineExecuter(new MemberInvoker(), ScenarioInterpreter, _listener); ContextFactory = new StoryContextFactory(); }
private void SetUpScenarioExecutorForCurrentProject(TaskExecutionNode node) { var projectTask = node.RemoteTask as RunProjectTask; var mapper = new StoryContextFactory(); projectTask.Assemblies.ForEach(mapper.AddAssembly); _executor = new ScenarioExecutor(Server, mapper); }
public void SetupContext() { var mapper = new StoryContextFactory(); mapper.AddContext<TestMappingContext>(); StoryContext = mapper.GetContextForStory(new Story("", "", new IScenario[] {})); }
public void Throws_if_no_context_added() { var mapper = new StoryContextFactory(); Expect.ThisToThrow<ConfigurationException>(() => mapper.GetContextForStory(new Story("unknown type", "totally bogus", new List<IScenario>()))); }
public void Should_Register_Assembly_Types() { var mapper = new StoryContextFactory(); mapper.AddAssembly(GetType().Assembly); var context = mapper.GetContextForStory(new Story("context test", "context test", new List<IScenario>())); context.ImplementingTypes.ShouldContain(typeof (TestMappingContext)); }
public void Should_Map_By_ContextAttribute() { var story = new Story("context test", "context test", new List<IScenario>()); var mapper = new StoryContextFactory(); mapper.AddContext<TestMappingContext>(); var context = mapper.GetContextForStory(story); context.ImplementingTypes.First().ShouldEqual(typeof (TestMappingContext)); }