I was assigned to develop a function in VBScript to compare a result set returned from a SQL query with an expected result set.
My problem is what format of expected result set should be organized. What is a good approach for this? Or simply execute SQL query, store it in a string and compare it with another string - expected result set.
Can anyone help me a better solution? Thanks so much.
Here are the steps-
a. Use ADODB object
b. Generate both result sets from database
c. Set it to appropriate variables
d. Get it to the loop
e. Compare the values in the variables inside the loop
f. Generate the compared test results using ASSERT statements.
The only thing that you need to take care of here is that both the data must be in the same form that is datatype. This can always be done using the convert method, and also if there is some float value be careful enough to do the round off appropriately. Best approach is to put them both into string format and use compare function.