In the wiki, on this page: http://wiki.github.com/Jakobo/snaptest/mocking-static-classes the last paragraph isn't very clear to me...
It says, that, if you want to test an object, that calls a static function, you should refactor the call in a protected method, so you can use setReturnValue().
I'm assuming, that in the example given, a object of type foo is tested. So what I don't understand is: in this case, foo is not a mock object (obviously, since I want to test it), so how could I use setReturnValue() on it?
I hope my question is clear.....
Thanks in advance,
Matthias Loitsch
m...@tthias.com
So instead of calling Foo::create("bar") in the middle of a method,
create a protected method instead to isolate the static call. This
allows you to use setReturnValue() normally to return mocked objects.
I've updated the docs as well.
Regards,
Jakob
> --
> You received this message because you are subscribed to the Google Groups "snaptest" group.
> To post to this group, send email to snap...@googlegroups.com.
> To unsubscribe from this group, send email to snaptest+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/snaptest?hl=en.
>
>