Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public void TestWithDateVariable(IConfigurationResultExporter exporter, ProgramOptions options)
        {
            string runTestFileName = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, "%date%-runtest", options);

            Assert.IsEqual(runTestFileName, DateTime.Now.ToString("ddMMyyy") + "-runtest.xml");
        }
Exemplo n.º 5
0
        public void TestWithFilename(IConfigurationResultExporter exporter, ProgramOptions options)
        {
            string runTestFilename = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, "runtest", options);

            Assert.IsEqual(runTestFilename, "runtest.xml");
        }