Class MaxNewInstancesAttribute
Checks that no more than a specific number of new instances exist after the target method has been executed.
Inherited Members
Namespace: SciTech.NetMemProfiler
Assembly: SciTech.MemProfilerApi.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class MaxNewInstancesAttribute : AssertionAttribute
Remarks
This attribute can be applied to methods to define that no more than a specific number of new instances should exist on the GC heap after the target method has been executed.
For more information see AssertionsDefinition.MaxNewInstances(Type[], Boolean, Int32) and AssertionAttribute.
Constructors
Name | Description |
---|---|
MaxNewInstancesAttribute(String, Int32) | Initializes a new instance of MaxNewInstancesAttribute with the type name of the instances that should be checked and the maximum number of new instances allowed. |
MaxNewInstancesAttribute(String[], Int32) | Initializes a new instance of MaxNewInstancesAttribute with the type names of the instances that should be checked and the maximum number of new instances allowed. |
MaxNewInstancesAttribute(Type, Int32) | Initializes a new instance of MaxNewInstancesAttribute with the type of the instances that should be checked and the maximum number of new instances allowed. |
MaxNewInstancesAttribute(Type[], Int32) | Initializes a new instance of MaxNewInstancesAttribute with the types of the instances that should be checked and the maximum number of new instances allowed. |
Properties
Name | Description |
---|---|
InstanceCount | Gets a value indicating the maximum number of new instances that should exist after the target method has been executed. |