void ReportError(string testName, ErrorSeverity severity, string itemId, string message, params object[] args)
        {
            if (m_errWriter == null)
            {
                m_errWriter = new Parse.CsvWriter(m_errFilename, false);
                m_errWriter.Write(new string[] { "TestName", "Severity", "ItemId", "Message" });
            }

            string outMessage = string.Format(message, args);
            m_errWriter.Write(new string[] { testName, severity.ToString(), itemId, outMessage });
            //Console.WriteLine("    " + outMessage);
            #if DEBUG1
            Debug.Fail(outMessage);
            #endif
        }
 public ToCsvProcessor(string osFilename, string oiFilename, OutputFormat outputFormat)
 {
     OutputFormat = outputFormat;
     #if !DEBUG
     if (File.Exists(osFilename)) throw new ApplicationException(string.Format("Output file, '{0}' already exists.", osFilename));
     if (File.Exists(oiFilename)) throw new ApplicationException(string.Format("Output file, '{0}' already exists.", oiFilename));
     #endif
     if (osFilename != null)
     {
         m_sWriter = new Parse.CsvWriter(osFilename, false);
         string[] fieldNames = (OutputFormat == OutputFormat.Dw) ? Enum.GetNames(typeof(DwStudentFieldNames)) : Enum.GetNames(typeof(AllStudentFieldNames));
         m_sWriter.Write(fieldNames);
     }
     if (oiFilename != null)
     {
         m_iWriter = new Parse.CsvWriter(oiFilename, false);
         string[] fieldNames = (OutputFormat == OutputFormat.Dw) ? Enum.GetNames(typeof(DwItemFieldNames)) : Enum.GetNames(typeof(AllItemFieldNames));
         m_iWriter.Write(fieldNames);
     }
 }
        public TestPackageProcessor(string oFilename)
        {
            string itemFilename = oFilename + ".items.csv";
            string stimFilename = oFilename + ".stims.csv";
            m_errFilename = oFilename + ".errors.csv";
            #if DEBUG
            if (File.Exists(m_errFilename)) File.Delete(m_errFilename);
            #else
            if (File.Exists(itemFilename)) throw new ApplicationException(string.Format("Output file, '{0}' already exists.", itemFilename));
            if (File.Exists(stimFilename)) throw new ApplicationException(string.Format("Output file, '{0}' already exists.", stimFilename));
            if (File.Exists(m_errFilename)) throw new ApplicationException(string.Format("Output file, '{0}' already exists.", m_errFilename));
            #endif
            m_itemWriter = new Parse.CsvWriter(itemFilename, false);
            m_itemWriter.Write(Enum.GetNames(typeof(ItemFieldNames)));

            m_stimWriter = new Parse.CsvWriter(stimFilename, false);
            m_stimWriter.Write(Enum.GetNames(typeof(StimFieldNames)));
        }