public void ShouldSetMemberfilterForMethodInfoOfTypeMethod() { StoryRunnerFilter filter = null; MemberInfo member = null; Given( () => { var stack = new StackFrame(2); // member = stack.GetMethod(); } ); When( () => { filter = StoryRunnerFilter.GetFilter(member); } ); Then( () => { Assert.That(filter.MethodNameFiler.ToString(), Is.EqualTo("^ShouldSetMemberfilterForMethodInfoOfTypeMethod$")); Assert.That(filter.ClassNameFilter.ToString(), Is.EqualTo("^" + typeof(StoryRunnerFilterSpecs).Name + "$")); Assert.That(filter.NamespaceFilter.ToString(), Is.EqualTo("^" + typeof(StoryRunnerFilterSpecs).Namespace + "$")); } ); }
public static StoryRunnerFilter Context <TActionStepsClass>(this StoryRunnerFilter filter) { Type type = typeof(TActionStepsClass); string classFilterValue = filter.ClassNameFilter.UpdateWith(type.Name); var namespaceFilter = filter.NamespaceFilter.UpdateWith(type.Namespace); return(new StoryRunnerFilter(namespaceFilter, classFilterValue, filter.MethodNameFiler.ToString())); }
private NBehaveConfiguration(bool createAppDomain) { CreateAppDomain = createAppDomain; EventListener = new NullEventListener(); Filter = new StoryRunnerFilter(); TagsFilter = new List <string[]>(); Assemblies = new List <string>(); }
private static void Execute(this string scenario, StoryRunnerFilter filter, IEnumerable<Assembly> assemblies, params IEventListener[] eventListenersArg) { var eventListeners = new List<IEventListener>(); eventListeners.AddRange(eventListenersArg); eventListeners.Add(new ColorfulConsoleOutputEventListener()); eventListeners.Add(new FailSpecResultEventListener()); var multiEventListener = new MultiOutputEventListener(eventListeners.ToArray()); var builder = new TextScenarioRunner(multiEventListener, assemblies, filter); builder.Run(scenario); }
private static void Execute(this string scenario, StoryRunnerFilter filter, IEnumerable <Assembly> assemblies, params IEventListener[] eventListenersArg) { var eventListeners = new List <IEventListener>(); eventListeners.AddRange(eventListenersArg); eventListeners.Add(new ColorfulConsoleOutputEventListener()); eventListeners.Add(new FailSpecResultEventListener()); var multiEventListener = new MultiOutputEventListener(eventListeners.ToArray()); var builder = new TextScenarioRunner(multiEventListener, assemblies, filter); builder.Run(scenario); }
private TestRunState Run(Assembly assembly, MemberInfo member, ITestListener tddNetListener) { var locator = new StoryLocator { RootLocation = Path.GetDirectoryName(assembly.Location) }; var type = member as Type; var stories = (type == null) ? locator.LocateAllStories() : locator.LocateStoriesMatching(type); var results = NBehaveConfiguration .New .DontIsolateInAppDomain() .SetEventListener(new StoryRunnerEventListenerProxy(tddNetListener)) .SetScenarioFiles(stories) .SetAssemblies(new[] { assembly.Location }) .SetFilter(StoryRunnerFilter.GetFilter(member)) .Build() .Run(); return(GetTestRunState(results)); }
public override void SetUp() { _storyRunnerFilter = new StoryRunnerFilter(GetType().Namespace, StoryRunnerFilter.MatchAnything, StoryRunnerFilter.MatchAnything); base.SetUp(); }
public static StoryRunnerFilter And <TActionStepsClass>(this StoryRunnerFilter filter) { return(filter.Context <TActionStepsClass>()); }
public NBehaveConfiguration SetFilter(StoryRunnerFilter filter) { Filter = filter; return(this); }
public override void SetUp() { _storyRunnerFilter = new StoryRunnerFilter(GetType().Namespace, ".", "."); base.SetUp(); }
public static void Execute(this string scenario, StoryRunnerFilter filter, params IEventListener[] eventListeners) { scenario.Execute(filter, ActionStepAssemblies); }
private static void Execute(this string scenario, StoryRunnerFilter filter, params Assembly[] assemblies) { Execute(scenario, filter, assemblies, new IEventListener[] {}); }
public TextScenarioRunner(IEventListener eventListener, IEnumerable<Assembly> actionStepAssemblies, StoryRunnerFilter storyRunnerFilter) { _eventListener = eventListener; _actionStepAssemblies = actionStepAssemblies; _storyRunnerFilter = storyRunnerFilter; }
public TextScenarioRunner(IEventListener eventListener, IEnumerable <Assembly> actionStepAssemblies, StoryRunnerFilter storyRunnerFilter) { _eventListener = eventListener; _actionStepAssemblies = actionStepAssemblies; _storyRunnerFilter = storyRunnerFilter; }
public static void Execute(this string scenario, StoryRunnerFilter filter, params IEventListener[] eventListeners) { scenario.Execute(filter, ActionStepAssemblies); }
private static void Execute(this string scenario, StoryRunnerFilter filter, params Assembly[] assemblies) { Execute(scenario, filter, assemblies, new IEventListener[] { }); }