See https://github.com/matthewsteeples/testattributes for a repro
If you run the DerivedTestMethod1 test, the following methods _should_ be executed
* ClassInit.AssemblyInitialize
* ClassInit.ClassInitMethod
* DerivedClassInit.ClassInitMethod2
* DerivedClassInit.DerivedTestMethod1
The 2nd bullet point does not get executed by NCrunch, but does by MSTest
Build/Test Issues
ClassInitializeAttribute from Base Class isn't executed (MSTest)
Started by MatthewSteeples on 2,580 views
Remco NCrunch Developer
#16867
09 Sep 2023 00:07 UTC
Hi, thanks for sharing this.
Yes, we have no handling for InheritanceBehavior.BeforeEachDerivedClass. I'll take a look and see if we can find a way to introduce it.
Yes, we have no handling for InheritanceBehavior.BeforeEachDerivedClass. I'll take a look and see if we can find a way to introduce it.
Edited 09 Sep 2023 00:07 UTC
Hi Remco,
Just wondering if you'd had chance to have a look at this yet? Not necessarily the InstanceBehaviour attribute but the ability for multiple ClassInit methods to be called.
Just wondering if you'd had chance to have a look at this yet? Not necessarily the InstanceBehaviour attribute but the ability for multiple ClassInit methods to be called.
Remco NCrunch Developer
#16886
27 Sep 2023 23:34 UTC
Sorry, we've pretty snowed under with V5 work at the moment. I hope to get to this issue later in the year. I'd recommend adapting your code with a workaround for the time being, I don't think I'll be able to provide a fix for this in the short term.
No problem. We'll find a workaround
Post a reply
Log in to reply.