Class SceneGraphicsTestAttribute
Attribute to create a new Scene Graphics Test. When used, it will create a new test case for the method it is applied to.
Implements
Inherited Members
Namespace: UnityEngine.TestTools.Graphics
Assembly: UnityEngine.TestTools.Graphics.dll
Syntax
public class SceneGraphicsTestAttribute : GraphicsTestAttributeBase, ITestBuilder, IImplyFixture, ITestAction
Remarks
This attribute uses the SceneGraphicsTestCaseSource class to create the test cases.
Constructors
SceneGraphicsTestAttribute(params string[])
Creates a new instance of the SceneGraphicsTestAttribute class.
Declaration
public SceneGraphicsTestAttribute(params string[] scenePaths)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | scenePaths | The paths to the scenes to be used for the test. These paths are relative to the project folder and must be in a path that is indexed by the Unity Asset Database. |
Remarks
Valid scene paths are:
- Direct paths to Unity scene assets, e.g. Assets/Scenes/TestScene.unity
- Paths to asset directories, e.g. Assets/Scenes. In this case, all scenes in the directory and its subdirectories will be included.
- Regular expressions only for the file names of test scenes, e.g. Assets/Scenes/[0-9]+.
The regular expressions may not affect the base directory, so Assets/.*/TestScene.unity or equivalent is not valid.
You may also not use backslashes as path separators when using the regex feature. Assets\Scenes/[0-9]+ is invalid, but Assets/Scenes/\d+ is valid.
- Paths from any directory recognized by the AssetDatabase, so Packages/YourPackageName/Scenes is also valid.
SceneGraphicsTestAttribute(Type, params string[])
Creates a new instance of the SceneGraphicsTestAttribute class.
Declaration
public SceneGraphicsTestAttribute(Type source, params string[] scenePaths)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | source | The type of the source to be used for the test. This is usually SceneGraphicsTestCaseSource or a derived class. |
| string[] | scenePaths | The paths to the scenes to be used for the test. These paths are relative to the project folder and must be in a path that is indexed by the Unity Asset Database. |
Remarks
Valid scene paths are:
- Direct paths to Unity scene assets, e.g. Assets/Scenes/TestScene.unity
- Paths to asset directories, e.g. Assets/Scenes. In this case, all scenes in the directory and its subdirectories will be included.
- Regular expressions only for the file names of test scenes, e.g. Assets/Scenes/[0-9]+.
The regular expressions may not affect the base directory, so Assets/.*/TestScene.unity or equivalent is not valid.
You may also not use backslashes as path separators when using the regex feature. Assets\Scenes/[0-9]+ is invalid, but Assets/Scenes/\d+ is valid.
- Paths from any directory recognized by the AssetDatabase, so Packages/YourPackageName/Scenes is also valid.