Method NoInstances
NoInstances(TypeSet)
Defines that no instances of any type in the provided typeSet
should exist when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(TypeSet typeSet)
Parameters
Type | Name | Description |
---|---|---|
TypeSet | typeSet | A TypeSet containing the types of the instances that should be checked. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of any type in the
typeSet
exists, unless the type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
NoInstances(Type[], Boolean)
Defines that no instances of the provided types
(and optionally
their subclasses) should exist when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(Type[] types, bool includeSubclasses)
Parameters
Type | Name | Description |
---|---|---|
System.Type[] | types | An array containing the System.Types that should be checked. |
System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified type should be checked. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of the provided types (and optionally
their subclasses) exists, unless the type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
NoInstances(Type[])
Defines that no instances of the provided types
should exist when this
definition is asserted using MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(Type[] types)
Parameters
Type | Name | Description |
---|---|---|
System.Type[] | types | An array containing the System.Types that should be checked. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of the provided types exists, unless the
type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
NoInstances(Type, Boolean)
Defines that no instances of the provided type
(and optionally
its subclasses) should exist when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(Type type, bool includeSubclasses)
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 type should be checked. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of the provided type (and optionally
its subclasses) exists, unless the type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
NoInstances(Type)
Defines that no instances of the provided type
should exist when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The System.Type of the instances that should be checked. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of the provided type
exists, unless the type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
NoInstances(String[], Boolean)
Defines that no instances of Types
that matches the provided names (and optionally
their subclasses) should exist when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(string[] typeNames, bool includeSubclasses)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | typeNames | An array containing the names of the |
System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should be checked. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of the provided types (and optionally
their subclasses) exists, unless the type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
note
The name of a Type
can end with the wildcard character '*',
which allows all types that starts with the specified text
to be matched. This can be used to include all types in a namespace
(e.g. “System.Windows.Forms.*” will include all types in
the System.Windows.Forms namespace).
NoInstances(String[])
Defines that no instances of Types
that matches the provided names
should exist when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(string[] typeNames)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | typeNames | An array containing the names of the |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of the provided types (and optionally
their subclasses) exists, unless the type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
note
The name of a Type
can end with the wildcard character '*',
which allows all types that starts with the specified text
to be matched. This can be used to include all types in a namespace
(e.g. "System.Windows.Forms.*" will include all types in
the System.Windows.Forms namespace).
NoInstances(String, Boolean)
Defines that no instances of the Types
that matches the provided name (and optionally
its subclasses) should exist when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(string typeName, bool includeSubclasses)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | 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. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of a type that matches the provided name (and optionally
its subclasses) exists, unless the type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
note
The name of the Type
can end with the wildcard character '*',
which allows all types that starts with the specified text
to be matched. This can be used to include all types in a namespace
(e.g. “System.Windows.Forms.*” will include all types in
the System.Windows.Forms namespace).
NoInstances(String)
Defines that no instances of the Types
that matches the provided name (and optionally
their subclasses) should exist when this definition is asserted using
MemAssertion.
MemAssertion.Assert.
Declaration
public AssertionsDefinition NoInstances(string typeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | An array containing the type names of the instances that should be checked. |
Returns
Type | Description |
---|---|
AssertionsDefinition | Returns |
Remarks
Calling MemAssertion.
MemAssertion.Assert
using this AssertionsDefinition will fail if an instance of a type that matches the provided name (and optionally
its subclasses) exists, unless the type is also included in a call to an AllowXXX
or MaxXXX
method.
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.
note
The name of the Type
can end with the wildcard character '*',
which allows all types that starts with the specified text
to be matched. This can be used to include all types in a namespace
(e.g. “System.Windows.Forms.*” will include all types in
the System.Windows.Forms namespace).