How to do unit testing on Squidex?

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [ :white_check_mark:] Documentation issue or request

What is the general way to develop and run unit testing for a C# App using Squidex as DB?

Can we create an environment with all the schema but empty content, for the test?

Is it possible to create a snapshot before each test, and restore the backup after the test run?


App Name: middle-stage-phone-pk

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ :white_check_mark:] Cloud version

Version: Init

Browser: [Doesn’t matter]

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge


It is independent from the programming language.

the main question is: Do you want to do unit testing or integration testing?

Unit testing

To make unit testing easier, Squidex provides interfaces for all clients and the client manager:

You can use this to mock these services, e.g. with FakeItEasy:

Integration testing

Usually for integration testing you should have a separate environment. You can either use the CLI and the sync command to create a plain app that you use for starting everything or you do it manually:

It would be better, if you do this with self hosted instance inside your CI, so we can easily get rid of the chunk data, e.g. in the github CI I start a docker-compose with all my dependencies and use this to run a few hundred tests on that:

Hello, thanks a lot for the elaboration. I am going to try out these options.