private static void Main(string[] args) { try { AppUtility.ParseArgs(args); TestResultBuilder builder = new TestResultBuilder(); TestSuites testSuites = builder.Build(new TestResultBuilderArgument { TestCases = new CheckModReportFileParser().ParseFile(ApplicationData.ModCheckReportFilePath, ApplicationData.TestMode), TestSuiteName = "Mod::Check()" }); TestSuiteWriter writer = new TestSuiteWriter(); string testName = "TEST-" + DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".xml"; writer.WriteToFile(testSuites, Path.Combine(ApplicationData.EaWUnitReportOutputPath, testName)); } catch (Exception e) { Console.Error.WriteLine($"An error occured {e}", e.Message); ApplicationData.ExitCode = 1; AppUtility.PrintUsage(); } Environment.Exit(ApplicationData.ExitCode); }
void CreateTestResultBuilder(IVsTestTestProvider testProvider) { var executionContext = new ExecutionContext((IExecutionHandler)null, null, null); monitor = new TestProgressMonitor(); context = new TestContext(monitor, null, executionContext, DateTime.Now); builder = new TestResultBuilder(context, testProvider); }
private void DumpResults(string workingDirectory) { TestResultBuilder .From(workingDirectory) .ForEach(PublishTestResults); }