Skip to content

XUnit share context without constructor injection #2597

Answered by bradwilson
NiceStepUp asked this question in Question
Discussion options

You must be logged in to vote

You don't need to add the constructor if you don't need access to the fixture object from within the unit test. It will still be created appropriately.

If you do need access to the fixture object, then there's no way around this today. Constructor injection is the only way to get access to fixture objects in v2.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bradwilson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants