You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "NightOwl888 (via GitHub)" <gi...@apache.org> on 2026/04/22 14:50:56 UTC

Re: [I] Prevent users from overriding test framework setup/teardown functionality [lucenenet]

NightOwl888 commented on issue #1087:
URL: https://github.com/apache/lucenenet/issues/1087#issuecomment-4297228798

   NUnit 4 has [Execution Hooks](https://docs.nunit.org/articles/nunit/extending-nunit/Execution-Hooks.html) that could allow us to implement this task in a more reliable way. And they could also be used as triggers for implementing #1088. Would you like to have a look to see if this can work? If so, then we may be able to side-step the issues with having these 4 attributes defined in our base class as virtual methods.
   
   It could eliminate the need for any code analyzers, but if NUnit doesn't call the base class first during the "before" methods and last after "after" methods, we may still need to report incorrect usage of these attributes to consumers.
   
   This could even allow us to scan for our own attributes and reverse the calling order if NUnit is different than Java. I see a lot of potential here and this would definitely sway me in the direction of upgrading to v4.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org