Constructor MaxInstancesAttribute
MaxInstancesAttribute(Type, Int32)
Initializes a new instance of MaxInstancesAttribute with the type of the instances that should be checked and the maximum number of instances allowed.
Declaration
public MaxInstancesAttribute(Type type, int instanceCount)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | System.Type of the instances that should be checked. |
System.Int32 | instanceCount | Defines the maximum number of instances that should exist after the target method has been executed. |
Remarks
For more information see AssertionsDefinition.MaxInstances(Type, Boolean, Int32) and AssertionAttribute.
MaxInstancesAttribute(Type[], Int32)
Initializes a new instance of MaxInstancesAttribute with the types of the instances that should be checked and the maximum number of instances allowed.
Declaration
public MaxInstancesAttribute(Type[] types, int instanceCount)
Parameters
Type | Name | Description |
---|---|---|
System.Type[] | types | An array containing the System.Types of the instances that should be checked. |
System.Int32 | instanceCount | Defines the maximum number of instances that should exist after the target method has been executed. |
Remarks
For more information see AssertionsDefinition.MaxInstances(Type[], Boolean, Int32) and AssertionAttribute.
MaxInstancesAttribute(String, Int32)
Initializes a new instance of MaxInstancesAttribute with the type name of the instances that should be checked and the maximum number of instances allowed.
Declaration
public MaxInstancesAttribute(string typeName, int instanceCount)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | Type name of the instances that should be checked. |
System.Int32 | instanceCount | Defines the maximum number of instances that should exist after the target method has been executed. |
Remarks
For more information see AssertionsDefinition.MaxInstances(String, Boolean, Int32) and AssertionAttribute.
MaxInstancesAttribute(String[], Int32)
Initializes a new instance of MaxInstancesAttribute with the type namess of the instances that should be checked and the maximum number of instances allowed.
Declaration
public MaxInstancesAttribute(string[] typeNames, int instanceCount)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | typeNames | An array containing the type names of the instances that should be checked. |
System.Int32 | instanceCount | Defines the maximum number of instances that should exist after the target method has been executed. |
Remarks
For more information see AssertionsDefinition.MaxInstances(String[], Boolean, Int32) and AssertionAttribute.