public TestCaseDTO[] DiscoverTests() { var conv = new DefaultConventions().Initialize(); var finder = new SpecFinder(SandboxedAssembly.GetTypes(), ""); var cb = new ContextBuilder(finder, new Tags()); var dia = new DiaSession(SandboxedAssembly.Location); var examples = cb.Contexts() .Build() .AllContexts() .SelectMany(context => context.Examples); var result = from example in examples let method = GetAction(example) let location = dia.GetNavigationData(method.DeclaringType.FullName, method.Name) ?? new DiaNavigationData(null, 0, 0) select new TestCaseDTO { Name = example.FullName(), FileName = location.FileName, LineNumber = location.MinLineNumber, Traits = example.Tags.ToArray() }; return(result.ToArray()); }
public void Execute(IReceiveTestResult observer) { this.observer = observer; var finder = new SpecFinder(SandboxedAssembly.GetTypes(), ""); var cb = new ContextBuilder(finder, new Tags()); cb.Contexts() .Build() .ForEach(context => context.Run(this, false)); }
public void Execute(IReceiveTestResult observer, string[] testNames) { this.observer = observer; var examples = new HashSet <string>(testNames); var finder = new SpecFinder(SandboxedAssembly.GetTypes(), ""); var cb = new ContextBuilder(finder, new Tags()); cb.Contexts() .Build() .SelectMany(c => c.AllExamples()) .Where(example => examples.Contains(example.FullName())) .ForEach(example => example.Context.Run(this, false, example.Context.GetInstance())); }