summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-04-20 19:09:33 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-04-20 19:09:33 -0400
commit7c1e566113d59699af1624186c64eca67f063fc6 (patch)
tree5a6850a695986872d5d0b09d7dab8421628fe33e /Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs
parentdd117b77aae1d8be7563b360d05b842a73b7dab2 (diff)
downloadProject-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.tar.gz
Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.tar.bz2
Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.zip
Upgraded Unity
Diffstat (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs')
-rw-r--r--Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs77
1 files changed, 0 insertions, 77 deletions
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs
deleted file mode 100644
index 0c14397..0000000
--- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using NUnit.Framework;
-using NUnit.Framework.Interfaces;
-using NUnit.Framework.Internal;
-
-namespace UnityEngine.TestRunner.NUnitExtensions
-{
- internal static class TestResultExtensions
- {
- public static void RecordPrefixedException(this TestResult testResult, string prefix, Exception ex, ResultState resultState = null)
-
- {
- if (ex is NUnitException)
- {
- ex = ex.InnerException;
- }
-
- if (resultState == null)
- {
- resultState = testResult.ResultState == ResultState.Cancelled
- ? ResultState.Cancelled
- : ResultState.Error;
- }
-
- var exceptionMessage = ExceptionHelper.BuildMessage(ex);
- string stackTrace = "--" + prefix + NUnit.Env.NewLine + ExceptionHelper.BuildStackTrace(ex);
- if (testResult.StackTrace != null)
- {
- stackTrace = testResult.StackTrace + NUnit.Env.NewLine + stackTrace;
- }
-
- if (testResult.Test.IsSuite)
- {
- resultState = resultState.WithSite(FailureSite.TearDown);
- }
-
- if (ex is ResultStateException)
- {
- exceptionMessage = ex.Message;
- resultState = ((ResultStateException)ex).ResultState;
- stackTrace = StackFilter.Filter(ex.StackTrace);
- }
-
- string message = (string.IsNullOrEmpty(prefix) ? "" : (prefix + " : ")) + exceptionMessage;
- if (testResult.Message != null)
- {
- message = testResult.Message + NUnit.Env.NewLine + message;
- }
-
- testResult.SetResult(resultState, message, stackTrace);
- }
-
- public static void RecordPrefixedError(this TestResult testResult, string prefix, string error, ResultState resultState = null)
-
- {
- if (resultState == null)
- {
- resultState = testResult.ResultState == ResultState.Cancelled
- ? ResultState.Cancelled
- : ResultState.Error;
- }
-
- if (testResult.Test.IsSuite)
- {
- resultState = resultState.WithSite(FailureSite.TearDown);
- }
-
- string message = (string.IsNullOrEmpty(prefix) ? "" : (prefix + " : ")) + error;
- if (testResult.Message != null)
- {
- message = testResult.Message + NUnit.Env.NewLine + message;
- }
-
- testResult.SetResult(resultState, message);
- }
- }
-} \ No newline at end of file