« Return to Thread: test is not failing for additional expectations

Re: test is not failing for additional expectations

by Ashutosh Kumar-4 :: Rate this Message:

| View in Thread

I am writing this way

oneOf(statement).execute();//This is present in actual method implementation so it isneeded.

oneOf(statement).addBatch();//This is not needed . But test passes whether it is present in   my test code or not. I expect test to fail (saying expected method was not invoked) but this does not happen.

Thanks
Ashutosh

On Thu, Aug 5, 2010 at 5:44 PM, Panos Konstantinidis <girionis@...> wrote:
Maybe you forgot to assert them and you don't even call the assertions on them.

--- On Thu, 8/5/10, Ashutosh Kumar <ashutosh.k78@...> wrote:

From: Ashutosh Kumar <ashutosh.k78@...>
Subject: [jmock-user] test is not failing for additional expectations
To: user@...
Date: Thursday, August 5, 2010, 1:11 PM


My test case works correctly if I define all expectations(it passes) or if I do not define some of the expectations(it fails). But if I define some additional expectations using one of , I expect test to fail as these methods are not there in actual implementation. But still the test passes.
 
Thanks
Ashutosh


 « Return to Thread: test is not failing for additional expectations