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: 8.2.23
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
Methods
  NameDescription
Public methodCleanUpBase
Cleans test base (Restore static context)
(Inherited from AutomatedTests.)
Public methodCleanUpDatabase
Cleans the current test environment.
Public methodCleanUpFakes
Cleans test base (Restore static context)
(Inherited from AutomatedTestsWithData.)
Public methodCleanUpFixtureBase
Initializes the text fixture for all tests
(Inherited from AutomatedTests.)
Public methodStatic memberCleanUpSharedDatabase
Removes shared instance database in MSTest tests. Note: Use this method in method marked with [ClassCleanup] attribute.
Public methodCleanUpSharedDatabaseNUnit
Removes shared instance database in NUnit tests. Note: This method is called automatically in NUnit tests.
Public methodDispose
Disposes the object
(Inherited from AutomatedTests.)
Public methodFake
Returns the entry which provides the fake methods from various modules
(Inherited from AutomatedTestsWithData.)
Protected methodFakeTInfo, TProvider(TProvider, Boolean)
Fakes the data for the given info and provider
(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.)
Protected methodGetClassAndAssemblyCategories
Get categories assigned to current test class and assembly.
(Inherited from AutomatedTests.)
Public methodGetClassXmlSchemaT
Gets the class XML schema for the given type
(Inherited from AutomatedTestsWithData.)
Public methodInitBase
Inits test base (Ensures static context, reset handlers)
(Inherited from AutomatedTests.)
Public methodInitDatabase
Initializes the current test environment.
Public methodInitFixtureBase
Initializes the text fixture for all tests
(Inherited from AutomatedTests.)
Public methodStatic memberInitSharedDatabase
Init shared instance database in MSTest tests. Note: Use this method in method marked with [ClassInitialize] attribute.
Public methodInitSharedDatabaseNUnit
/// Init shared instance database in NUnit tests.
Public methodResetAllFakes
Resets all fakes registered within the system
(Inherited from AutomatedTestsWithData.)
Top
Extension Methods
  NameDescription
Public Extension MethodAsValue
Converts object to a query value which can be used as a query parameter
(Defined by QueryExtensions.)
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
Top
Properties
  NameDescription
Public propertyLockContext Obsolete.
If true, the test locks the context
(Inherited from AutomatedTests.)
Public propertyUniqueStaticContext Obsolete.
If true, the test uses it's own unique static context. Note that this only applies to static variables defined through CMSStatic and CMSStaticObject.
(Inherited from AutomatedTests.)
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