Method AllocatingGCMemory
AllocatingGCMemory()
A constraint type that invokes the delegate you provide as the parameter of Assert.That and checks whether it causes any GC memory allocations.
Declaration
public static AllocatingGCMemoryConstraint AllocatingGCMemory()
Returns
Type | Description |
---|---|
AllocatingGCMemoryConstraint | An AllocationGCMemoryConstrain. |
Examples
using Is = UnityEngine.TestTools.Constraints.Is;
class MyTestClass
{
[Test]
public void MyTest()
{
Assert.That(() => {
var i = new int[500];
}, Is.AllocatingGCMemory());
}
}