❔ xunit field scope
lets say i have a class for unit testing below:
will
s1
and s2
have the same dep1
instance or will they get different ones? thanks4 Replies
Same
@xianzai wo you bingqiling @Mernayi https://xunit.net/docs/shared-context#:~:text=xUnit.net%20creates%20a%20new%20instance%20of%20the%20test%20class%20for%20every%20test%20that%20is%20run%2C%20so%20any%20code%20which%20is%20placed%20into%20the%20constructor%20of%20the%20test%20class%20will%20be%20run%20for%20every%20single%20test.
Also you could verify this just by logging
GetHashCode
methodWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.