Method MaxAllocations
MaxAllocations(TypeSet, Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(TypeSet typeSet, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| TypeSet | typeSet | A TypeSet containing the types of the allocations that should be checked. |
| System.Int32 | allocationsCount | Defines the maximum number of allocations that are allowed to be performed of the specified types. |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.
MaxAllocations(Type[], Boolean, Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(Type[] types, bool includeSubclasses, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type[] | types | An array containing the System.Types of the allocations that should be checked. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should be checked. |
| System.Int32 | allocationsCount |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.
MaxAllocations(Type[], Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(Type[] types, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type[] | types | An array containing the System.Types of the instances that should be checked. |
| System.Int32 | allocationsCount | Defines the maximum number of allocations that are allowed to be performed of the specified types. |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.
MaxAllocations(Type, Boolean, Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(Type type, bool includeSubclasses, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The System.Type of the instances that should be checked. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should be checked. |
| System.Int32 | allocationsCount |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.
MaxAllocations(Type, Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(Type type, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The System.Type of the instances that should be checked. |
| System.Int32 | allocationsCount | Defines the maximum number of allocations that are allowed to be performed of the specified types. |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.
MaxAllocations(String[], Boolean, Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(string[] typeNames, bool includeSubclasses, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | typeNames | An array containing the type names of the instances that should be checked. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should be checked. |
| System.Int32 | allocationsCount |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.
MaxAllocations(String[], Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(string[] typeNames, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | typeNames | An array containing the type names of the instances that should be checked. |
| System.Int32 | allocationsCount | Defines the maximum number of allocations that are allowed to be performed of the specified types. |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.
MaxAllocations(String, Boolean, Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(string typeName, bool includeSubclasses, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | typeName | The type name of the instances that should be checked. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should be checked. |
| System.Int32 | allocationsCount |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.
MaxAllocations(String, Int32)
Defines that no more than the specified number of allocations are allowed of the provided types when this definition is asserted using MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxAllocations(string typeName, int allocationsCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | typeName | The type name of the instances that should be checked. |
| System.Int32 | allocationsCount | Defines the maximum number of allocations that are allowed to be performed of the specified types. |
Returns
| Type | Description |
|---|---|
| AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.Assert
using this AssertionsDefinition will allow up to allocationsCount allocations
of the specified types. If more than allocationsCount allocations are performed, then
calling MemAssertion.Assert
using this AssertionsDefinition will fail.