-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do we mock objects #26
Comments
So, if I understand it correctly, the scenario is that we are testing Service A and Service A calls Service B's getTimestamps() method which returns mock Timestamp values. If this is the case then its easily covered by using EasyMock framework that can do this for us. |
Can you put the gist of design? Sent from my iPhone On 16 Sep 2012, at 10:41, Anuj Kumar [email protected] wrote:
|
Heres a pseudo code of how you can do it:
|
Ya, we can mock objects in this way. Regards, On Mon, Sep 17, 2012 at 2:50 PM, Anuj Kumar [email protected]:
|
Currently there is no specific support for such a thing. And it would be a good idea to have such a support. Although, I am first inclined to finish the CSVWriter and XMLWriter functionality and cleaning up the DataDrivenTest Class slightly before introducing any new functionality. I have started work on XMLWriter already. Can you look at the CSVWriter if and when you get some time? |
Let us say a method requires some values from another object or from some other service class.
How do we mock those values and provide test data for those values?
For ex:
In a method, they take Timestamp value from a facade and use that value as part of preparing criteria query in it, please note this Timestamp value is not a parameter. It would be better to somehow inject the list of timestamps while calling the method, Timestamps list would have a list including leap year dates, 31st Dec, 1st Jan etc..
Please think over it.
The text was updated successfully, but these errors were encountered: