Class CleanupUtil
Tracks and cleans up objects that require disposal or destruction after tests.
When added to a test fixture, CleanupUtil automatically cleans up all registered
objects after the test execution.
Inherited Members
Namespace: UnityEngine.UIElements.TestFramework
Assembly: Unity.UI.TestFramework.Runtime.dll
Syntax
public class CleanupUtil : UITestComponent
Remarks
For an example usage, refer to Clean up objects after tests.
Methods
AddDestructible(Object)
Adds an object for destruction after the test.
Declaration
public void AddDestructible(Object destructible)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | destructible | The |
AddDisposable(IDisposable)
Adds an object for disposal after the test.
Declaration
public void AddDisposable(IDisposable disposable)
Parameters
| Type | Name | Description |
|---|---|---|
| IDisposable | disposable | The object for disposal. |
AfterTest()
Cleans up CleanupUtil after each test.
Declaration
protected override void AfterTest()
Overrides
Cleanup()
Cleans up all objects that you added for disposal or destruction.
Declaration
public void Cleanup()