This project is read-only.

More examples please

Oct 26, 2009 at 4:20 PM

This is very interesting stuff! Not sure I completely understand the example though, but there might be some assumptions in it, that I have not taken into account (like method1- and method2-body), or?

Watching this space closely! :-)

Keep it up...

Oct 27, 2009 at 11:10 AM

Hi

Yes, very interesting indeed !

It does pretty much what you would expect from at mock framework.

I have two issues that I could'n get working:

1) My "ClassToMock" has no parameters in the "new" method, which resulted in a MockProxy... class that couln't compile.
The new method looked like this "public void new(SysMockRepositoryImpl _mockRepositoryImpl, SysMockObjectType _mockType, )" <<--- Error: ends with comma.

2) I want to set an expectation for a method with return type "void". How can I do that ?
I tried SysMockExpect::call(classToMock.sendMail()).return(Types::void);

and SysMockExpect::call(classToMock.sendMail('test'));

Looking forward to future updates.

Nov 13, 2009 at 3:24 PM

Hi,

 

Thank you for feedback!

1. I'll fix this bug in next release, I hope it will be done in a week.

2. If you want to set expectaion for such kind of methods, you can just call this method, i.e:

classToMock.sendMail();

SysMockExpect - class is used to specify return value, error or custom action.

For example if you want sendMail method to throw exception you can write somethig like this:

classToMock.sendMail();

SysMockExcpect::call().error("error text");

 

Please let me know, if you have any questions.

Nov 13, 2009 at 3:25 PM

Thanks! Let me know if you have any questions or if you need more examples.