-
Notifications
You must be signed in to change notification settings - Fork 18
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
Unit tests for exceptions are failing 'in harmony' (.NET 7) #39
Comments
It's been an ongoing issue discussed in the standard community with the InternalMock library. I think we just need to regroup the team and discuss progress on the two projects so we can rekindle that progress ... |
I feel like if we're having to mock things for testing then we need to ask if we're on the wrong track. I've been able to guarantee stability with Restier using extensive internal unit tests and clean, simple integration tests. It's a problem easily solved by disallowing |
That's an interesting take. For me I previously raised a concern that testing private methods was effectively testing implementation details which in unit testing circles is often referred to as an anti-pattern behaviour. Marking the methods internal instead actually solves the need to use Harmony at all. I think there's some interesting "ethos" discussions to be had in this area that affects the entire standard community, I'd be interested to see what a poll might uncover if we reached enough people for it to be considered an accurate reflection of views. You do have a point though ... |
Tests for exceptions are created using InternalMock. It's constructed using:
The InternalMock implementation depends on Harmony to patch private methods.
This patching fails in some situations:
but, running tests in test explorer ('Debug') succeeds
The cause seems to be originated in MonoMod.Common as mentioned in Harmony issue 504
Waiting for .NET 7 support might not be the way forward pardeike/Harmony#504 (comment)
The text was updated successfully, but these errors were encountered: