Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Sitecore FakeDb is available on NuGet. To install the framework:
- Create a new
- Run the following command in the NuGet Package Manager Console:
PM> Install-Package Sitecore.FakeDb
- Add references to the following assemblies:
Lucene.Net.dll Sitecore.Analytics.dll Sitecore.Kernel.dll Sitecore.Logging.dll Sitecore.Nexus.dll
- Configure license.
Applying the license file
There are several ways to configure the license:
license.xmlfile to the root of your tests project
That is the default license file location, so no any additional changes in the
Modify the 'LicensePath' setting in the
It allows to control the license file location, but requires merging the
App.configwhen updating the FakeDb NuGet package.
license.xmlas an existing file to the root of your tests project
It allows to avoid modifying the
LicenseFilesetting in the
App.configfile and allows to run tests in NCrunch without configuring the
Additional files to includesetting.
Note: If using NUnit 3.x, when copying the license file to your test project root, you will need to update the
LicenseFile setting to
/license.xml in the
Configuring the Database type for Sitecore 8.2 and later
Starting from Sitecore 8.2, the Database type is changed from
Sitecore.Data.DefaultDatabase (see the Configuration file changes section for details). In the test project
App.config file, ensure the proper type is selected:
<!-- DATABASE TYPE For Sitecore versions prior to 8.2 should be 'Sitecore.Data.Database, Sitecore.Kernel'. For Sitecore 8.2 and later should be 'Sitecore.Data.DefaultDatabase, Sitecore.Kernel'. --> <sc.variable name="databaseType" value="Sitecore.Data.DefaultDatabase, Sitecore.Kernel" />
To upgrade the framework run the following command in the NuGet Package Manager Console:
PM> Update-Package Sitecore.FakeDb
You should always overwrite the
App.configfile if requested. Otherwise important configuration changes might be lost.