Skip to content

Running the integration tests

Nicholas Sizer edited this page Mar 26, 2018 · 5 revisions

Configuration

The unit tests should run without any work as they are isolated from an ASE Server dependency. However the integration tests need an ASE Server to work. Once you have one of those (version 15+), you'll need to add a DatabaseLoginDetails.json (.gitignore already has an entry) file to the root of the AdoNetCore.AseClient.Tests project directory.

The file should be of the form:

{
  "Server": "a",
  "Port": "b",
  "Database": "c",
  "User": "d",
  "Pass": "e"
}

You will need to define the Server, Port, Database, User and Pass parts to connect to your own ASE server.

When the tests are run, they will generate appropriate connection strings using the details provided.

The specified user will need sufficient permissions to drop and create database objects as well as perform SELECT, INSERT, UPDATE, and DELETE operations on those objects, and to EXEC stored procedures.

The objects themselves and any test data are created by the tests when they execute.

Running the tests

This can be done via whatever unit testing tooling you have, or by running something like the following from CLI:

dotnet test --no-build --no-restore --verbosity quiet --filter "TestCategory=quick | TestCategory=basic | TestCategory=extra"

(remove --no-build --no-restore --verbosity quiet if you want to turn off those flags).

Note about tools: the built in Visual Studio test runner doesn't run the tests for all target frameworks, just the first listed. This is fine for quick testing, but should be avoided when it comes time to submit a PR / merge.