Class CleanupUtil
Provides a way to track and clean up objects that need to be disposed or destroyed after tests.
When added to a test fixture, CleanupUtil will automatically clean up all objects that
were added to be disposed or destroyed after the test execution.
Inherited Members
Namespace: UnityEngine.UIElements.TestFramework
Assembly: Unity.UI.TestFramework.Runtime.dll
Syntax
public class CleanupUtil : UITestComponent
Methods
AddDestructible(Object)
Adds an object to be destroyed after the test.
Declaration
public void AddDestructible(Object destructible)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | destructible | The |
AddDisposable(IDisposable)
Adds an object to be disposed after the test.
Declaration
public void AddDisposable(IDisposable disposable)
Parameters
| Type | Name | Description |
|---|---|---|
| IDisposable | disposable | The object to be disposed of. |
AfterTest()
Cleans up CleanupUtil after each test.
Declaration
protected override void AfterTest()
Overrides
Cleanup()
Cleans up all objects that were added to be disposed or destroyed.
Declaration
public void Cleanup()