Previous | Next
Topic: Testing query vs single value
Conf: 538, Msg: 39840
From: Chris Rimmer (chris@nominet.org.uk)
Date: 12/7/00 05:28 AM

Testing query vs single value Chris Rimmer chrisrimmer chris.rimmer@tessella.co.uk I'm not sure if its just me, but I seem to find myself much of the time using utAssert.eqquery to test one query against a trivial one which returns a fixed value. So if I want to check that my procedure has deleted a set of records from a table, I end up comparing the following queries:

SELECT COUNT(*)
FROM My_Table
WHERE Some_Condition;

SELECT 0 from DUAL;

The main problem with this (apart from some extra typing) is that when it fails, I just get told it failed, with no details.

I would like something that looks like this:

utAssert.eqqueryvalue(msg_in VARCHAR2,
check_query_in VARCHAR2,
against_value_in VARCHAR2/NUMBER/DATE,
raise_exc_in BOOLEAN);

that fails if the query returns multiple values and tells me what it got when it returns the wrong value (i.e. by calling utAssert.eq)

Chris