This is an example solution showing a super simple set of tests against a Neo4j server that is started at the beginning of the test, and shut down afterwards. In each of the projects, the server is:
- Installed as a service
- Started
- Populated with data
- Tested against
- Stopped
- Uninstalled
IF you have a server already installed on your machine - and you run this with out changing any settings - this will wipe it, so be cautious!
- You need to install the Windows SDK (for PowerShell automation)
- You will need to run the tests as an Administrator
- This includes either Visual Studio (if using the built in test runner / ReSharper) or a PowerShell/Command Prompt
- This is because we're installing a service to do the tests.
- Download the ZIP version of Neo4j from the Neo4j Website and unzip into a folder of your choice.
- [Optional] Edit the
conf/neo4j.conf
- Change
dbms.windows_service_name=
to something meaningful, for example:neo4j-integration-testserver
- Change the ports for Bolt/REST endpoints
- Change
- Run Visual Studio as an Administrator
- Edit the
app.config
file to point to the server - in particular if you changed any port / security settings in step 2- This is shared between all the projects, so you only need to edit one of them.
- Edit the
appsettings.json
file to point to the server as well.- This is shared between all the projects, so you only need to edit one of them.
- Run the tests!
- Should work with
- VS Test Runner (group by Project to get the best output)
- ReSharper
- XUnit Console Runner (XUnit only Obvs)
- NUnit Console Runner (NUnit only again - Obvs)
- Should work with
- Not Running as Admin
- Because we need to install a new service, you need to be an Administrator
- Unable to find server to run tests
- Check your config (
appsettings.json
andapp.config
) are in sync and both point to the right place
- Check your config (