Click or drag to resize
IsolatedIntegrationTests Class
Allows integration tests to run in isolation as for each test a clean database with current schema and default objects is created.
Inheritance Hierarchy

Namespace: CMS.Tests
Assembly: CMS.Tests (in CMS.Tests.dll) Version: 9.0.0
Syntax
C#
public class IsolatedIntegrationTests : AutomatedTestsWithData

The IsolatedIntegrationTests type exposes the following members.

Constructors
  NameDescription
Protected methodIsolatedIntegrationTests
Initializes a new instance of the IsolatedIntegrationTests class.
Top
Properties
  NameDescription
Public propertyCurrentTestName
Current test name
(Inherited from AutomatedTests.)
Public propertyLastTestName
Last test name
(Inherited from AutomatedTests.)
Public propertySharedDatabaseForAllTests

Indicates if the same database is used for all tests in same test class.

Top
Methods
  NameDescription
Public methodAddExtender
Adds the test extender
(Inherited from AutomatedTests.)
Public methodCleanUpBase
Cleans test base (Restore static context)
(Inherited from AutomatedTests.)
Public methodCleanUpFixtureBase
Initializes the text fixture for all tests
(Inherited from AutomatedTests.)
Public methodDispose
Disposes the object
(Inherited from AutomatedTests.)
Protected methodEndApplication
Performs application end
(Inherited from AutomatedTests.)
Public methodEnsureExtraDatabase
Ensures the specified extra database for the test
Public methodEnsureLicense
Inserts the license for localhost according to related config key
Public methodExecuteWithAllDatabases
Executes the same given action in the context of all test databases. Original database is handled first.
Public methodExecuteWithExtraDatabase
Executes the given action in the context of the given extra database
Public methodFake
Returns the entry which provides the fake methods from various modules
(Inherited from AutomatedTestsWithData.)
Protected methodFakeTInfo(InfoFakeSettings)
Fakes the data for the given info
(Inherited from AutomatedTestsWithData.)
Protected methodFakeTInfo, TProvider(TProvider, Boolean)
Fakes the data for the given info and provider
(Inherited from AutomatedTestsWithData.)
Protected methodFakeLicense
Fakes the license for localhost according to related config key
(Inherited from AutomatedTestsWithData.)
Public methodFakeObjectTInfo
Fakes the data for the given info
(Inherited from AutomatedTestsWithData.)
Public methodFakeObjectsTInfo
Fakes the data for the given info
(Inherited from AutomatedTestsWithData.)
Public methodGetClassXmlSchemaT
Gets the class XML schema for the given type
(Inherited from AutomatedTestsWithData.)
Protected methodGetTestExtenders
Gets the current test extenders
(Inherited from AutomatedTests.)
Public methodGetTestUniqueIndex
Gets a unique index for the test run. All calls from a single test run return the same index.
Protected methodInitApplication
Performs application initialization if not already initialized
(Inherited from AutomatedTests.)
Public methodInitBase
Inits test base (Ensures static context, reset handlers)
(Inherited from AutomatedTests.)
Public methodInitFixtureBase
Initializes the text fixture for all tests
(Inherited from AutomatedTests.)
Public methodInitSharedDatabase
Init shared instance database in MSTest tests. Note: Use this method in method marked with [ClassInitialize] attribute.
Public methodIsolatedIntegrationTestsFixtureSetup
Init shared instance database in NUnit tests.
Public methodIsolatedIntegrationTestsFixtureTearDown
Removes shared instance database in NUnit tests. Note: This method is called automatically in NUnit tests.
Public methodIsolatedIntegrationTestsSetup
Initializes the current test environment.
Public methodIsolatedIntegrationTestsTearDown
Cleans the current test environment.
Public methodResetAllFakes
Resets all fakes registered within the system
(Inherited from AutomatedTestsWithData.)
Public methodResetAppState
Resets the application state
(Inherited from AutomatedTests.)
Protected methodRunExtenderActionTCurrentLevel
Gets the current test extenders
(Inherited from AutomatedTests.)
Protected methodTestMilestone
Milestone
(Inherited from AutomatedTests.)
Public methodTestsWithDataFixtureSetup
Fixture setup
(Inherited from AutomatedTestsWithData.)
Public methodTestsWithDataFixtureTearDown
Fixture tear down
(Inherited from AutomatedTestsWithData.)
Public methodTestsWithDataSetup
Test setup
(Inherited from AutomatedTestsWithData.)
Public methodTestsWithDataTearDown
Cleans test base (Restore static context)
(Inherited from AutomatedTestsWithData.)
Top
Remarks
The isolated integration tests use LocalDB to create and drop databases when needed. It works with two types of database. The master database is created using SQL scripts from the solution. For each modification of this folder a new master database is created. The master database is detached after it has been created and its files are copied to create an instance database that a running test will use. The instance and master databases share a name, but the file names are different. The instance database is removed when a test finishes and a master database, that is out of date, is removed automatically.
See Also