A question on assertion please
Sorry to bother you again, I have a question on assertion please
I use SoapUI Pro (and am testing API Ready now) to do functional test on medical rules, here's a simple example:
Medical Rule 123: A child who's 2 years old should have MMR vaccine
In the xml request I offer a child's date of birth, ruleID=123, if the child is 2 years old (as of today), it displays the ruleID of123 in the response and send an alert to the child's doctor, if the child is not 2 years old, it doesn't display the ruleID and no alert is generated
For the data source I use Excel spreadsheet like:
DOB RuleID isEligible
2013-01-01 123 true --- 2 years old
2014-01-01 123 false --- not 2 years old
2013-01-02 123 false --- 2 years old
I've created the related properties "DOB" and "ruleID" for data driven test, and I'd like to add an assertion on ruleID in response, if I have ruleID 123 displayed in response then the child is eligible for vaccine
I was thinking to use "contains" (for ruleID=123) assertion, for the above 1st child, the response contains ruleID=123, so the child is eligible for vaccine, and since I set isEligible to true, this test case should pass; for the 2nd child, the response doesn't contain ruleID=123, so the child is not eligible and since I set isEligible to false, this test case should also pass; the 3rd child is also 2 years old but I set isEligible to false, so this test case should fail
How do I implement "isEligible" comparing with the assertion result please?
Thanks a lot for help
Jerry