private static void Main(string[] args) { var showHelp = false; var assemblies = Enumerable.Empty <string>(); var optionSet = new Options { { "h|help", "show this message and exit", x => showHelp = x != null }, { "a=|assemblies=", "comma-seperated list of the names of assemblies to test", x => assemblies = x.Split(',') } }; try { optionSet.Parse(args); if (showHelp) { ShowHelp(optionSet); return; } if (!assemblies.Any()) { throw new InvalidOperationException("No assemblies specified."); } } catch (InvalidOperationException exception) { Console.Write(string.Format("{0}: ", AppDomain.CurrentDomain.FriendlyName)); Console.WriteLine(exception.Message); Console.WriteLine("Try {0} --help for more information", AppDomain.CurrentDomain.FriendlyName); return; } assemblies.ForEach(x => new PrintFailuresOutputter().Output(x, SimpleRunner.RunAllInAssembly(x))); }
private IEnumerable <TestResult> runAllTests(Assembly assembly) { TestResult failresult = null; IEnumerable <RunResult> results = null; try { results = SimpleRunner.RunAllInAssembly(assembly); } catch (Exception ex) { failresult = new TestResult(Identifier, assembly.FullName, "", 0, "Error while running tests", TestState.Panic, getMessage(ex) + Environment.NewLine + Environment.NewLine); failresult.AddStackLines(getStackLines(ex)); } if (failresult != null) { yield return(failresult); } else { if (results == null) { yield break; } foreach (var res in results) { yield return(BuildTestResult(res)); } } }
private static void Main(string[] args) { args = new string[] { "Empathica.TwitterChallenge.Tests.dll" }; args.ForEach(x => new PrintFailuresOutputter().Output(SimpleRunner.RunAllInAssembly(x))); Console.ReadLine(); }
static void Main(string[] args) { args.ForEach(x => new PrintFailuresOutputter().Output(SimpleRunner.RunAllInAssembly(x))); }
static void Main(string[] args) { SimpleRunner.RunAllInAssembly(typeof(Program).Assembly).ForEach(PrintSpec); }