Asserts that the memory usage since the specified comparison snapshot meets the memory usage defined by the supplied AssertionsDefinition.

The comparison snapshot can be provided using the comparisonSnapshot parameter. If no comparison snapshot is provided, then the snapshot returned from the last call to FastSnapShot()()()() or FullSnapShot()()()() will be used.

Normally only instances created by the same thread as the caller are checked, but by supplying the value All for the assertionsThread parameter, it is possible to include instances created by any thread. Unless all threads are synchronized with the thread making the assertions, it it recommended that one of the NoNewInstances methods that do not accept an assertionsThread parameter is used, or that AssertionsThread.Caller is supplied for the assertionsThread parameter.

Overload List

  Name Description
Public method Static member Assert(AssertionsDefinition)
Asserts that the memory usage since the last call to FastSnapShot()()()() or FullSnapShot()()()() meets the memory usage defined by the supplied AssertionsDefinition. Only instances created by the calling thread will be checked by this assertion.
Public method Static member Assert(AssertionsDefinition, AssertionsThread)
Asserts that the memory usage since the last call to FastSnapShot()()()() or FullSnapShot()()()() meets the memory usage defined by the supplied AssertionsDefinition.
Public method Static member Assert(MemSnapShot, AssertionsDefinition)
Asserts that the memory usage since the comparisonSnapshot meets the memory usage defined by the supplied AssertionsDefinition. Only instances created by the calling thread will be checked by this assertion.
Public method Static member Assert(MemSnapShot, AssertionsDefinition, AssertionsThread)
Asserts that the memory usage since the comparisonSnapshot meets the memory usage defined by the supplied AssertionsDefinition.

See Also