Is this really the version you are looking for? Kentico Xperience 12 Service Pack Documentation is no longer updated. Use the switcher in the header to choose your product version.
Isolated integration tests are automated tests 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.
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.
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.
Open the solution containing your test project in Visual Studio.
Make the test class inherit from the IsolatedIntegrationTests base class.
using CMS.Tests;
using NUnit.Framework;
[TestFixture]
public class MyIntegrationTests : IsolatedIntegrationTests
{
...
}Write the required isolated integration test methods.
(Optional) Create an app.config file in your test project and set the following keys under the configuration/appSettings section:
<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.