-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GD-104: Fix exception failure message propagation (#108)
# Why see #106 # What fixing the extraction of inner exception to catch the right exception message
- Loading branch information
1 parent
edb26bd
commit aee3ae6
Showing
5 changed files
with
95 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
test/src/core/resources/testsuites/mono/TestSuiteAllTestsFailWithExceptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace GdUnit4.Tests.Core; | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
|
||
// will be ignored because of missing `[TestSuite]` annotation | ||
// used by executor integration test | ||
public class TestSuiteAllTestsFailWithExceptions | ||
{ | ||
|
||
[TestCase] | ||
public void ExceptionIsThrownOnSceneInvoke() | ||
{ | ||
var runner = ISceneRunner.Load("res://src/core/resources/scenes/TestSceneWithExceptionTest.tscn"); | ||
|
||
runner.Invoke("SomeMethodThatThrowsException"); | ||
} | ||
|
||
[TestCase] | ||
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously | ||
public async Task ExceptionAtAsyncMethod() | ||
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously | ||
=> throw new ArgumentException("outer exception", new ArgumentNullException("inner exception")); | ||
|
||
[TestCase] | ||
public void ExceptionAtSyncMethod() | ||
=> throw new ArgumentException("outer exception", new ArgumentNullException("inner exception")); | ||
|
||
} |