Skip to content

Expose ExpectedResult to the TestContext #4101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
garyhuntddn opened this issue Apr 21, 2022 · 2 comments
Closed

Expose ExpectedResult to the TestContext #4101

garyhuntddn opened this issue Apr 21, 2022 · 2 comments

Comments

@garyhuntddn
Copy link
Contributor

garyhuntddn commented Apr 21, 2022

We have a scenario where we have extensive test cases which use the ExpectedResult argument of the TestCase attribute.

Within those test we have a new need to be able to assess the ExpectedResult.

Rather than convert the tests so that the ExpectedResult is passed in as an argument and an assert performed we would like to be able to examine the ExpectedResult in the same we can see the MethodName and the Arguments.

We've been able to hack together a solution using reflection against the _test field and the internal ExpectedResult property of the TestMethod class but it would be nicer if we didn't have to do this.

See #4100 for a simple PR that exposes this property.

@manfred-brands
Copy link
Member

Can you explain your scenario a bit more?
Knowing the ExpectedResult in a test either is cheating or doing Nunit's job to compare the actual result with the expected.

@stevenaw
Copy link
Member

This was closed via #4100

@stevenaw stevenaw added this to the 4.0 milestone Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants