Created
June 26, 2017 00:28
-
-
Save cobysy/e8696e65617f24dd1ec3f24c69496076 to your computer and use it in GitHub Desktop.
AutoFixture notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In order to inject dependencies through constructor parameters, | |
// use greedy constructor selection (versus modest constructor query/ModestConstructorQuery) | |
// http://blog.ploeh.dk/2011/04/19/ConstructorstrategiesforAutoFixture/ | |
// | |
// OmitAutoProperties to stop it from mocking out properties | |
// See https://github.com/AutoFixture/AutoFixture/issues/320 for combo of GreedyConstructorQuery and OmitAutoProperties | |
AutoFixture.Customize<T>(c => c.FromFactory(new MethodInvoker(new GreedyConstructorQuery())).OmitAutoProperties()); | |
// Trace construction of objects | |
AutoFixture.Behaviors.Add(new TracingBehavior()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment