private static int GetExitCodeFromExporter(ProgramOptions options, IContextRunnerConfiguration context) { var exporter = GetExporter(options); int exporterResult = exporter.Export(context, ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, string.Empty, options)); return(exporter.TriggerApplicationExitCode ? exporterResult : 0); }
public void TestWithNoFileName(IConfigurationResultExporter exporter, ProgramOptions options) { string nameWithEmptyString = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, string.Empty, options); string nameWithNullString = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, null, options); string patternName = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, exporter.DefaultFileNamePattern, options); Assert.IsEqual(nameWithEmptyString, nameWithNullString); Assert.IsEqual(nameWithNullString, patternName); }
public void TestWithAssemblyVariable(IConfigurationResultExporter exporter, ProgramOptions options) { string current = Environment.CurrentDirectory; current = current.Substring(current.Replace("\\", "/").LastIndexOf("/") + 1); string expected = DateTime.Now.ToString("ddMMyyy") + "-%state%-" + current + ".xml"; string runTestFileName = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, null, options); Assert.IsEqual(runTestFileName, expected); }
public void TestWithDateVariable(IConfigurationResultExporter exporter, ProgramOptions options) { string runTestFileName = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, "%date%-runtest", options); Assert.IsEqual(runTestFileName, DateTime.Now.ToString("ddMMyyy") + "-runtest.xml"); }
public void TestWithFilename(IConfigurationResultExporter exporter, ProgramOptions options) { string runTestFilename = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, "runtest", options); Assert.IsEqual(runTestFilename, "runtest.xml"); }