Skip to content

Add TestException property to the TestContext#4018

Merged
Evangelink merged 3 commits intomicrosoft:mainfrom
Evangelink:testcontext-exception
Nov 11, 2024
Merged

Add TestException property to the TestContext#4018
Evangelink merged 3 commits intomicrosoft:mainfrom
Evangelink:testcontext-exception

Conversation

@Evangelink
Copy link
Copy Markdown
Member

Fixes #293

Youssef1313
Youssef1313 previously approved these changes Nov 8, 2024
testHostResult.AssertExitCodeIs(2);
testHostResult.AssertOutputContainsSummary(failed: 2, passed: 1, skipped: 0);
testHostResult.AssertOutputContains("Initialization method TestContextExceptionFailingInTestInit.TInit threw exception. System.InvalidOperationException");
testHostResult.AssertOutputContains("Test method TestContextExceptionFailingInTestMethod.TestFailingInTestMethod threw exception:");
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion type is on the next line but I validated manually it's good.

@Evangelink Evangelink disabled auto-merge November 11, 2024 12:35
@Evangelink Evangelink merged commit f9a6140 into microsoft:main Nov 11, 2024
@Evangelink Evangelink deleted the testcontext-exception branch November 11, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to get exception from test in TestCleanup?

2 participants