java - expect static call with some certain result -
I have found some steady calls from system functions in my system
long current data Milliseconds
How to test this call and set some specific results to use the powermaker?
I mean something like
System.currentTimeMillis (); . ExpectLastCall () andReturn (leftBound); // I hope to return a certain amount of milliseconds
Good ... I ' Done this way
fake (System.class); Hope (System.currentTimeMillis ()) andReturn (rightBound.getTime ()) replay all(); AssertTrue (DateUtils.isInRange (Leftbound, Rightbound)); VerifyAll ();
Comments
Post a Comment