Method MaxBytes
MaxBytes(TypeSet, Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances
of any type in the provided typeSet
when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(TypeSet typeSet, long byteCount)
Parameters
Type | Name | Description |
---|---|---|
TypeSet | typeSet | A TypeSet containing the types of the instances that should be checked. |
System.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
MaxBytes(Type[], Boolean, Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances of
the provided types
(and optionally their subclasses)
when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(Type[] types, bool includeSubclasses, long byteCount)
Parameters
Type | Name | Description |
---|---|---|
System.Type[] | types | An array containing the System.Types of the instances that should be checked. |
System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should be checked. |
System.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
MaxBytes(Type[], Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances of
the provided types
when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(Type[] types, long byteCount)
Parameters
Type | Name | Description |
---|---|---|
System.Type[] | types | An array containing the System.Types of the instances that should be checked. |
System.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
MaxBytes(Type, Boolean, Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances of
the provided type
(and optionally its subclasses)
when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(Type type, bool includeSubclasses, long byteCount)
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.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
MaxBytes(Type, Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances of
the provided type
when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(Type type, long byteCount)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The System.Type of the instances that should be checked. |
System.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
MaxBytes(String[], Boolean, Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances of
Types
that matches the provided names
(and optionally their subclasses) when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(string[] typeNames, bool includeSubclasses, long byteCount)
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.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
MaxBytes(String[], Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances of
Types
that matches the provided names
when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(string[] typeNames, long byteCount)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | typeNames | An array containing the type names of the instances that should be checked. |
System.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
MaxBytes(String, Boolean, Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances of
Types
that matches the provided name
(and optionally their subclasses) when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(string typeName, bool includeSubclasses, long byteCount)
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.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
MaxBytes(String, Int64)
Defines that no more than a specified number of bytes are allowed to be used by live instances of
Types
that matches the provided name
when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition MaxBytes(string typeName, long byteCount)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | The type name of the instances that should be checked. |
System.Int64 | byteCount | Defines the maximum number of bytes that are allowed to be used by live instances of the specified types. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will allow up to byteCount
bytes to be used by live instances
of the specified types. If more than byteCount
bytes are used by live instances, then
calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail.
note
The AllowXXX
(AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX
(MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX
(NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.