I’m using the .net client api and was wondering how people have gone about making fake event store connections to test related logic?
I get stuck with creating instances of the classes that the IEventStoreConnection methods return, for example the EventReadResult, StreamEventsSlice and the ResolvedEvent classes all have only internal constructors.
Do people bother faking the store for testing and just use the real thing?
It’s a pretty hard class to fake overall - all the operations are asynchronous and the behaviours are fairly complex.
If you’re testing your application logic you probably want to be faking the repository (or whatever other abstraction you’ve built over the event store) instead, and when it comes to actually testing that abstraction you probably want to be using the real thing. In recent versions you can use the `--mem-db` option to avoid creating files on disk while doing this - I’d just use Process.Start (if you’re on .NET) for this, or the equivalent on other platforms.