Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

ClassInitializeAttribute from Base Class isn't executed (MSTest)
MatthewSteeples
#1 Posted : Friday, September 8, 2023 8:11:20 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 121
Location: United Kingdom

Thanks: 7 times
Was thanked: 15 time(s) in 13 post(s)
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
Remco
#2 Posted : Saturday, September 9, 2023 12:07:35 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,841

Thanks: 901 times
Was thanked: 1222 time(s) in 1142 post(s)
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.021 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download