예제 #1
0
        /// <summary>
        /// ITestStep.Execute() implementation
        /// </summary>
        /// <param name='testConfig'>The Xml fragment containing the configuration for this test step</param>
        /// <param name='context'>The context for the test, this holds state that is passed beteen tests</param>
        public void Execute(XmlNode testConfig, Context context)
        {
            _delayBeforeCheck = context.ReadConfigAsInt32(testConfig, "DelayBeforeCheck");
            _connectionString = context.ReadConfigAsString(testConfig, "ConnectionString");
            var queryConfig = testConfig.SelectSingleNode("SQLQuery");

            _sqlQuery             = SqlQuery.BuildSQLQuery(queryConfig, context);
            _numberOfRowsExpected = context.ReadConfigAsInt32(testConfig, "NumberOfRowsExpected", true);

            var rowCollection     = testConfig.SelectSingleNode("Rows");
            var bamValidationRows = rowCollection.SelectNodes("*");

            foreach (XmlNode bamValidationRow in bamValidationRows)
            {
                var drtv = new DBRowToValidate();

                var bamValidationCols = bamValidationRow.SelectNodes("*");
                foreach (XmlNode bamValidationCol in bamValidationCols)
                {
                    bool   isUnique = context.ReadConfigAsBool(bamValidationCol, "@isUnique", true);
                    string colName  = bamValidationCol.LocalName;
                    string colValue = bamValidationCol.InnerText;
                    var    dctv     = new DBCellToValidate(colName, colValue);
                    if (isUnique)
                    {
                        drtv.AddUniqueCell(dctv);
                    }
                    else
                    {
                        drtv.AddCell(dctv);
                    }
                }

                _dbRowsToValidate.AddRow(drtv);
            }

            Execute(context);
        }
예제 #2
0
        public void AddUniqueCell(DBCellToValidate cell)
        {
            ArgumentValidation.CheckForNullReference(cell, "cell");

            _cells.Add(cell);
        }
예제 #3
0
 public DBRowToValidate(DBCellToValidate uniqueCell)
 {
     _uniqueCell = uniqueCell;
 }
예제 #4
0
        /// <summary>
		/// ITestStep.Execute() implementation
		/// </summary>
		/// <param name='testConfig'>The Xml fragment containing the configuration for this test step</param>
		/// <param name='context'>The context for the test, this holds state that is passed beteen tests</param>
		public void Execute(XmlNode testConfig, Context context)
		{
			_delayBeforeCheck = context.ReadConfigAsInt32( testConfig, "DelayBeforeCheck" );			
			_connectionString = context.ReadConfigAsString( testConfig, "ConnectionString" );
			var queryConfig = testConfig.SelectSingleNode( "SQLQuery" );
            _sqlQuery = SqlQuery.BuildSQLQuery(queryConfig, context);
            _numberOfRowsExpected = context.ReadConfigAsInt32(testConfig, "NumberOfRowsExpected", true);			

            var rowCollection = testConfig.SelectSingleNode("Rows");
            var bamValidationRows = rowCollection.SelectNodes("*");
            foreach (XmlNode bamValidationRow in bamValidationRows)
            {
                var drtv = new DBRowToValidate();
                
                var bamValidationCols = bamValidationRow.SelectNodes("*");
                foreach (XmlNode bamValidationCol in bamValidationCols)
                {
                    bool isUnique = context.ReadConfigAsBool(bamValidationCol, "@isUnique", true);
                    string colName = bamValidationCol.LocalName;
                    string colValue = bamValidationCol.InnerText;
                    var dctv = new DBCellToValidate(colName, colValue);
                    if (isUnique)
                    {
                        drtv.AddUniqueCell(dctv);
                    }
                    else
                    {
                        drtv.AddCell(dctv);
                    }
                }

                _dbRowsToValidate.AddRow(drtv);
            }

            Execute(context);
		}
예제 #5
0
        public void AddUniqueCell(DBCellToValidate cell)
        {
            ArgumentValidation.CheckForNullReference(cell, "cell");

            _cells.Add(cell);
        }
예제 #6
0
 public DBRowToValidate(DBCellToValidate uniqueCell)
 {
     _uniqueCell = uniqueCell;
 }