Mock/Stub Classes For Unit Testing?

Nov 13, 2014 at 9:13 PM
Hey there,

I'm new to Casablanca, but I'm at a point in my usage where I'm able to use it in my project and everything seems to be working well. I need to write some tests now. I was wondering if this library provides any mock/stub classes that correspond to the Casablanca classes, like http_client, http_request, http_response, etc. I can't seem to find anything like that, so I'm almost to the point of having to wrap all the main library classes in order to have control of things in my tests, but I figured I'd try here first to see if anyone else has seen anything around written by anyone else. Someone else must have used this library and has wanted to test their own code's functionality, surely, right? Ha.

Thanks in advance.
Nov 14, 2014 at 2:06 AM
Hi capaci,

For testing our http_client and http_listener we have some test utilities and test client and server. I'd recommend you take a look at them, and depending on your scenario they might work for you. You can locate the http test utilities under Release\tests\Functional\http\utilities in the repository.