---
title: Creating isolated integration tests
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Isolated integration tests are [automated tests](https://docs.kentico.com/k10/custom-development/writing-automated-tests.md) that work with database objects within their own separate database. A new clean database instance is created for each test (using the default Kentico installation scripts) and then deleted after the test run. Note that integration tests are significantly slower than [unit tests with faked data](https://docs.kentico.com/k10/custom-development/writing-automated-tests/faking-info-and-provider-objects-in-unit-tests.md).

All test classes with isolated integration tests must inherit from the **IsolatedIntegrationTests** base class (provided by the _CMS.Tests_ library). The base class automatically performs database initialization before test runs and cleanup thereafter.

> **Note:** **Requirements**
>
> To use isolated integration tests, you need to have **Microsoft SQL Server 2012 Express LocalDB v11** (or newer) installed. LocalDB is automatically included in Visual Studio or Microsoft SQL Server installations.

## Creating isolated integration tests

1. Open the solution containing your [test project](https://docs.kentico.com/k10/custom-development/writing-automated-tests/creating-automated-test-projects.md) in Visual Studio.
2. Make the test class inherit from the **IsolatedIntegrationTests** base class.

   ```csharp

   using CMS.Tests;
   using NUnit.Framework;

   [TestFixture]
   public class MyIntegrationTests : IsolatedIntegrationTests
   {
       ...
   }

   ```
3. Write the required isolated integration test methods.
4. (Optional) Create an **app.config** file in your test project and set the following keys under the _configuration/appSettings_ section:

   - **CMSTestDatabaseScriptFolderPath**– the path to the folder with files required for database creation. The folder must contain the _SQL.zip_ file. If not specified, the test initialization searches the parent directories of the test project and attempts to locate the default Kentico installation scripts under the _CMS\App\_Data\Install_ folder path.
   - **CMSTestDatabaseFolderPath**– the path to the folder that will contain test databases. If not specified, the databases are stored in the _TestDatabases_ folder under the current solution's root folder.
   - **CMSTestDatabaseInstanceName**– the name of the SQL server instance used by tests. The default value is: _(LocalDB)\v11.0_

```xml

<appSettings>
  <add key="CMSTestDatabaseScriptFolderPath" value="C:\inetpub\wwwroot\Kentico\CMS\App_Data\Install" />
  <add key="CMSTestDatabaseFolderPath" value="C:\CustomDBFolder" />
  <add key="CMSTestDatabaseInstanceName" value="(localdb)\CustomTestingInstance" />
</appSettings>

```

Each test in a test class inheriting from **IsolatedIntegrationTests** uses its own database, which is automatically initialized before the test run and cleaned up after.
