public static IEnumerable <string> Run <TSampleTestClass>(Discovery discovery, Execution execution) { var listener = new StubListener(); RunTypes(listener, discovery, execution, typeof(TSampleTestClass)); return(listener.Entries); }
public static void ShouldHaveEntries(this StubListener actual, params string[] expected) { //Type.GetMethods(...) makes no guarantees about the order of the items returned, //so test execution order is not guaranteed, although in practice it is predictable. actual.Entries.OrderBy(x => x) .ShouldEqual(expected.OrderBy(x => x).ToArray()); }
Output Run <TExecution>(Type testClass) where TExecution : Execution, new() { var listener = new StubListener(); var execution = new TExecution(); using (var console = new RedirectedConsole()) { Utility.Run(listener, discovery, execution, testClass); return(new Output(console.Lines().ToArray(), listener.Entries.ToArray())); } }