예제 #1
0
		private void TypesSubTests(DbTypeParametersCollection typesToTest)
		{
			DbTypeParametersCollection currentlyTested = new DbTypeParametersCollection(typesToTest.TableName);
			int affectedRows;
			string rowId = string.Empty;

			foreach (DbTypeParameter currentParamType in typesToTest)
			{
				try
				{
					BeginCase("Test INSERT with parameter of type: " + currentParamType.DbTypeName);
					rowId = string.Format("13282_{0}", this.TestCaseNumber);
					currentlyTested.Clear();
					currentlyTested.Add(currentParamType);
					affectedRows = currentlyTested.ExecuteInsert(rowId);
					Compare(affectedRows, 1);
				} 
				catch(Exception ex)
				{
					exp = ex;
				}
				finally
				{
					EndCase(exp);
					exp = null;
					currentlyTested.ExecuteDelete(rowId);
				}
			}
		}
예제 #2
0
		private void TypesTests(DbTypeParametersCollection typesToTest)
		{
			exp = null;

			DbTypeParametersCollection currentlyTested = new DbTypeParametersCollection(typesToTest.TableName);
			string rowId = "13289";
			object dbValue;
			OleDbDataReader rdr = null;
			OleDbConnection selectCon = null;
			DataBaseServer testedDbServer = ConnectedDataProvider.GetDbType();

			foreach (DbTypeParameter currentParamType in typesToTest)
			{
				BeginCase("Test value of db type: " + currentParamType.DbTypeName);
				//Prepare data:
				rowId = string.Format("13289_{0}", this.TestCaseNumber);
				currentlyTested.Clear();
				currentlyTested.Add(currentParamType);
				currentlyTested.ExecuteInsert(rowId);

				try
				{
					currentlyTested.ExecuteSelectReader(rowId, out rdr, out selectCon);
					rdr.Read();
					dbValue = WorkaroundOracleCharsPaddingLimitation(testedDbServer, currentParamType, rdr.GetValue(0));
					if (currentParamType.Value.GetType().IsArray)
					{
						Compare(dbValue as Array, currentParamType.Value as Array);
					}
					else
					{
						Compare(dbValue, currentParamType.Value);
					}
				} 
				catch(Exception ex)
				{
					exp = ex;
				}
				finally
				{
					if (rdr != null && !rdr.IsClosed)
					{
						rdr.Close();
					}
					if (selectCon != null && selectCon.State != ConnectionState.Closed)
					{
						selectCon.Close();
					}
					currentlyTested.ExecuteDelete(rowId);
					EndCase(exp);
					exp = null;
				}
			}
		}