diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
| commit | c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 (patch) | |
| tree | ee4d51c7c1d633e11f46453ef1edd3c77c4ef9f7 /Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-itest-run-settings.md | |
| download | Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.gz Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.bz2 Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.zip | |
Inital commit
Diffstat (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-itest-run-settings.md')
| -rw-r--r-- | Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-itest-run-settings.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-itest-run-settings.md b/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-itest-run-settings.md new file mode 100644 index 0000000..7f7b06e --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-itest-run-settings.md @@ -0,0 +1,29 @@ +# ITestRunSettings
+`ITestRunSettings` lets you set any of the global settings right before building a Player for a test run and then reverts the settings afterward.
+`ITestRunSettings` implements [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable), and runs after building the Player with tests.
+
+## Public methods
+
+| Syntax | Description |
+| ---------------- | ------------------------------------------------------------ |
+| `void Apply()` | A method called before building the Player. |
+| `void Dispose()` | A method called after building the Player or if the build failed. |
+
+## Example
+The following example sets the iOS SDK version to be the simulator SDK and resets it to the original value after the run.
+``` C#
+public class MyTestSettings : ITestRunSettings
+{
+ private iOSSdkVersion originalSdkVersion;
+ public void Apply()
+ {
+ originalSdkVersion = PlayerSettings.iOS.sdkVersion;
+ PlayerSettings.iOS.sdkVersion = iOSSdkVersion.SimulatorSDK;
+ }
+
+ public void Dispose()
+ {
+ PlayerSettings.iOS.sdkVersion = originalSdkVersion;
+ }
+}
+```
\ No newline at end of file |
