Writing integration tests in Sitefinity CMS using MSTest V2 framework appears to be very similar to writing MSTest unit tests. The integration tests are structured in test classes. Each test class holds a set of tests, setup logic, and cleanup logic. For more information about each element, refer to the sections below.
The test classes hold the tests. You can use multiple test classes and group your tests depending on the functionality they cover. Each test class is represented by a class. To create a test class, perform the following:
SitefinityIntegrationTestsBase
TestClass
The tests are represented by methods, which contain the logic that you want to test. To create a test method, perform the following:
SitefinityIntegrationTest
TestCategory
Owner
Description
Ignore
ExpectedException
Note that the attributes for setup logic and cleanup logic are handled from the base class SitefinityIntegrationTestsBase. Therefore, if you implement some common setup and cleanup logic, you need to override the following methods:
ClassInitialize()
ClassCleanup()
TestInitialize()
TestCleanup()
Below is an integration tests example using MSTest V2 framework:
For more information, see the Integration Tests Sample on Sitefinity GitHub repository.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important