Mocking
Hi again.
I've got my create_project()
code working okay, but I'd now like to add some tests. I've been looking at a variety of mocking libraries to see if I can write tests that don't need to call out to a real Gitlab server. For a noob like me, these are all pretty hairy and I fear I'm over complicating my already working code just to get these mocking libs to play nicely. Is there an easy/idiomatic way that I can mock my shim trait code which wraps your API and just return one of the various types defined here (e.g., Project
)?
Any thoughts or recommendations as to how I might tackle this? I wondered if it was just a matter of instantiating a Project
in my mock's implementation, but there are so many child types that this starts to look unwieldy quite quickly. In a similar vein, have you thought about providing some testing/mocking APIs that make this kind of thing easier to accomplish?
Thanks in advance!
Brad