예제 #1
0
파일: Program.cs 프로젝트: Icepickle/wunit
        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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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");
        }
예제 #5
0
        public void TestWithFilename(IConfigurationResultExporter exporter, ProgramOptions options)
        {
            string runTestFilename = ExportFilenameHelper.GetFilenameForExportConfiguration(exporter, "runtest", options);

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