-
Notifications
You must be signed in to change notification settings - Fork 36
Installation
Sitecore FakeDb is available on NuGet. To install the framework:
- Create a new
Class Libraryproject. - 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.
There are several ways to configure the license:
-
Copy the
license.xmlfile to the root of your tests project
That is the default license file location, so no any additional changes in theApp.configrequired. -
Modify the 'LicensePath' setting in the
App.configfile
It allows to control the license file location, but requires merging theApp.configwhen updating the FakeDb NuGet package. -
Add the
license.xmlas an existing file to the root of your tests project
It allows to avoid modifying theLicenseFilesetting in theApp.configfile and allows to run tests in NCrunch without configuring theAdditional 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 App.config.
Starting from Sitecore 8.2, the Database type is changed from Sitecore.Data.Database to 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" />
https://github.com/sergeyshushlyapin/Sitecore.FakeDb/wiki/Configuration#configuring-ncrunch
To upgrade the framework run the following command in the NuGet Package Manager Console:
PM> Update-Package Sitecore.FakeDbImportant:
You should always overwrite the
App.configfile if requested. Otherwise important configuration changes might be lost.