public QATest(IRow testRow, ITable paramTable, bool canWrite) { if (testRow == null) throw new ArgumentNullException("testRow", "No row from the QA test table passed to constructor for QATest"); if (paramTable == null) throw new ArgumentNullException("paramTable", "No QA parameter table passed to constructor for QATest"); int index; index = testRow.Fields.FindField(TEST_NAME_FIELD); if (index < 0) throw new System.MissingFieldException(QATestCollection.TABLE_NAME, TEST_NAME_FIELD); this._name = testRow.get_Value(index).ToString(); index = testRow.Fields.FindField(COM_CLSID_FIELD); if (index < 0) throw new System.MissingFieldException(QATestCollection.TABLE_NAME, COM_CLSID_FIELD); this._comClsid = testRow.get_Value(index).ToString(); // Constrained to be YES or NO index = testRow.Fields.FindField(MANDITORY_FIELD); if (index < 0) throw new System.MissingFieldException(QATestCollection.TABLE_NAME, MANDITORY_FIELD); string isManditoryStr = testRow.get_Value(index).ToString(); this._isManditory = isManditoryStr.ToUpper().Equals("YES"); this._isActive = this._isManditory; // if manditory, make active // Try to instantiate a copy of the COM object try { System.Guid theGuid = new Guid(this._comClsid); this._test = this.CreateTestFromGuid(theGuid, true); // Load the parameter collection this._parameters = new QAParameterCollection(paramTable, this.Test); } catch (Exception ex) { util.Logger.Write("Could not instantiate a IDataQualityTest with CLSID '" + this._comClsid + "'" + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace.ToString(), util.Logger.LogLevel.Warn); } this._canWrite = canWrite; }
internal TestStatus(bool active, IDataQualityTest test) { this.active = active; this.test = test; }