Click or drag to resize

MemAssertionAssert Method (AssertionsDefinition, AssertionsThread)

Asserts that the memory usage since the last call to FastSnapshot Overload or FullSnapshot Overload meets the memory usage defined by the supplied AssertionsDefinition.

Namespace:  SciTech.NetMemProfiler
Assembly:  SciTech.MemProfilerApi (in SciTech.MemProfilerApi.dll) Version:
public static bool Assert(
	AssertionsDefinition assertionsDefinition,
	AssertionsThread assertionsThread


Type: SciTech.NetMemProfilerAssertionsDefinition
Defines the expected memory usage. For more information, see AssertionsDefinition.
Type: SciTech.NetMemProfilerAssertionsThread
Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked.

Return Value

Type: Boolean
If the current process is being profiled, true will be returned if the assertion succeeds, otherwise false will be returned.

If the current process is not being profiled, no assertion is performed and true will always be returned.