IsolatedAttribute Class

Typemock Isolator Developer Guide
Used to clean up the defined expectations. This attribute can't be inherited.
Inheritance Hierarchy

SystemObject
  SystemAttribute
    TypeMockDecoratorAttribute
      TypeMock.ArrangeActAssertIsolatedAttribute

Namespace:  TypeMock.ArrangeActAssert
Assembly:  Typemock.ArrangeActAssert (in Typemock.ArrangeActAssert.dll) Version: 9.3.6.0 (9.3.6.0)
Syntax

public sealed class IsolatedAttribute : DecoratorAttribute

The IsolatedAttribute type exposes the following members.

Constructors

  NameDescription
Public methodIsolatedAttribute
IsolatedAttribute constructor. Defines the DesignMode property to be the default Pragmatic mode.
Public methodIsolatedAttribute(DesignMode)
IsolatedAttribute constructor. Let's you specify the DesignMode to override the default Pragmatic mode for either the assmebly, class or test scope.
Top
Properties

  NameDescription
Public propertyCode exampleDesign
This property defines the design mode for either an assembly, class or a test method scope.
Public propertyHasTearDown
Signals that the test has a teardown method
(Inherited from DecoratorAttribute.)
Public propertyIgnoreStaleMocks
When set Typemock will not track stale mocks. A stale mock is an object that was faked in a previous test is used in current test. This may lead to an unexpected behavior.
(Inherited from DecoratorAttribute.)
Public propertyIsTearDown
Signals that the method being called is a teardown method
(Inherited from DecoratorAttribute.)
Protected propertyOriginalContext
Retrieves the instance that the original method was called with.
(Inherited from DecoratorAttribute.)
Protected propertyOriginalMethod
Retrieves the Original method info (the method which is tagged by the attribute)
(Inherited from DecoratorAttribute.)
Protected propertyOriginalParams
Retrieves the original parameters that were passed to the original method
(Inherited from DecoratorAttribute.)
Public propertyTypeId
When implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute.)
Top
Methods

  NameDescription
Protected methodCallDecoratedMethod
Activate the original (decorated) method.
(Inherited from DecoratorAttribute.)
Protected methodDecorateMethodWhenAttributeIsClass
Filter which methods to Execute the code, when the attribute is on a Class
(Inherited from DecoratorAttribute.)
Protected methodDontCallDecoratedMethod
Stops the decorator from calling the original method which is called automatically even when Execute method fails to call CallDecoratedMethod.
(Inherited from DecoratorAttribute.)
Public methodEquals
Returns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute.)
Public methodExecute
Called by the framework instead of the original method. This will run the original method and afterwards clear the MockManager.
(Overrides DecoratorAttributeExecute.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Returns the hash code for this instance.
(Inherited from Attribute.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsDefaultAttribute
When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute.)
Public methodMatch
When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

Any method marks with this attribute will clean all set expectation after the test is done. A marked class will do this for any test defined in it. The attribute can be replaced with the method.
Examples

[TestFixture]
[Isolated]
public TestClass
{
    [Test]
    public void MyTest1()
    {
        // the test code
    }
}
See Also

Reference