Testing a class library that uses ES

Hi,

I’m currently writing two class libraries that use the ES .net client.

With something like RavenDB I would be able to test these by using an embedded database. Is this possible by using the ES embedded client in my unit tests, or do I nmeed to spin up a server?

Kind regards

Sean.

Hi,

I’m currently writing two class libraries that use the ES .net client.

With something like RavenDB I would be able to test these by using an embedded database. Is this possible by using the ES embedded client in my unit tests, or do I nmeed to spin up a server?

Kind regards

Sean.

What are the main differences between going over TCP and the Embedded Client?

  1. there could be bugs in client API or server side code handling

  2. there can and are small implementational differences between embedded and clientapi

  3. not everything is supported over embedded client

In general embedded client is mostly the same but there are a few places behaviors can differ. If you want exact results server is generally better if you want good results to gate (not perfect) especially with a small surface area then embedded is great

Sean,

If it helps I got this running for my project this week - where I just start a separate process and connect over TCP.

Has been working out really well so far:

https://github.com/adbrowne/Eventful/blob/dev/src/Eventful.Tests.Integration/InMemoryEventStoreRunner.fs

cheers

Andrew

Hi Andrew,

Has this moved, I’ve just accessed the repo and can’t find the fine.

Any help appreciated.

Kind regards

Sean.

On Behalf Of Andrew Browne

Hi Sean,

The link still works for me. Maybe try this raw link:

https://raw.githubusercontent.com/adbrowne/Eventful/dev/src/Eventful.Tests.Integration/InMemoryEventStoreRunner.fs

If you browsed via github UI it’s not on master yet - still on the dev branch so if you select that first you might have better luck :slight_smile:

cheers

Andrew