示例#1
0
        } // ValidateConceptHeader

        /// <summary>
        /// Validate the row data
        /// </summary>
        /// <param name="csv"></param>
        /// <returns></returns>
        private bool ValidateConceptRows(ref ConceptCSV csv)
        {
            bool result = csv.ValidateRows();

            if (!result)
            {
                // TODO:  Fix this to display the bad data
                log.Error("Failed to validate row data for one or more rows");
                using (new CenterDialog(this))
                {
                    MessageBoxButtons buttons = MessageBoxButtons.OK;
                    MessageBox.Show($"Error in csv. Failed to validate data in one or more rows.  See log file and documentation for more information.", "Error in Rollout CSV Data", buttons);
                }
            }
            else
            {
                log.Debug("All row data is valid for all required columns");
            }
            return(result);
        } // ValidateConceptRows
示例#2
0
        public void TestGoodExampleSpreadsheet()
        {
            bool       passed      = true;
            ConceptCSV TestConcept = TestGoodRead();

            if (null != TestConcept)
            {
                passed = TestConcept.ValidateHeader();
                if (passed)
                {
                    passed = TestConcept.ValidateRows();
                    int numRows = TestConcept.RowCount;
                    passed = passed && (56 == numRows);
                    Assert.IsTrue(passed);
                }
            }
            else
            {
                Assert.IsTrue(false);
            }
        }