Defines that no more than the specified number of instances of the provided types are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).

Overload List

  Name Description
Public method MaxInstances(String, Int32)
Defines that no more than a specified number of instances of Types that matches the provided name are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Public method MaxInstances(array<String>[]()[][], Int32)
Defines that no more than a specified number of instances of Types that matches the provided names are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Public method MaxInstances(Type, Int32)
Defines that no more than a specified number of instances of the provided type are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Public method MaxInstances(array<Type>[]()[][], Int32)
Defines that no more than a specified number of instances of the provided types are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Public method MaxInstances(TypeSet, Int32)
Defines that no more than a specified number of instances of any type in the provided typeSet are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Public method MaxInstances(String, Boolean, Int32)
Defines that no more than a specified number of instances of Types that matches the provided name (and optionally their subclasses) are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Public method MaxInstances(array<String>[]()[][], Boolean, Int32)
Defines that no more than a specified number of instances of Types that matches the provided names (and optionally their subclasses) are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Public method MaxInstances(Type, Boolean, Int32)
Defines that no more than a specified number of instances of the provided type (and optionally its subclasses) are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Public method MaxInstances(array<Type>[]()[][], Boolean, Int32)
Defines that no more than a specified number of instances of the provided types (and optionally their subclasses) are allowed to exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).

Remarks

Calling MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread) using this AssertionsDefinition will allow up to instanceCount instances of the specified types to exist. If more than instanceCount instances exist, then calling MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread) using this AssertionsDefinition will fail.

See Also