Is it possible to implement something like this with autofixture injection?
// Fixture setup
var fields = _fixture.CreateMany<CsvDbUpdateFieldModel>(1).ToList();
_fixture.Inject(fields);
var kvp = _fixture.CreateMany<KeyValuePair<int, IList<CsvDbUpdateFieldModel>>>(1);
_fixture.Inject(kvp);
var dictionary = _fixture.Create<IDictionary<int, IList<CsvDbUpdateFieldModel>>>();
_fixture.Inject(dictionary);
...
What I want is to get a Dictionary with one kvp, with IList<CsvDbUpdateFieldModel>
containing 1 element, which declared before. But now AutoFixture create IList<CsvDbUpdateFieldModel>
with 3 randomly generated items, which probably not that I want. May be some details of AutoFixture Dictionary creation should help me..
I know how to create only one, and how to build dictionary from scratch. I ask how to force AutoFixture to use injected before kvp to automatically build dictionary, using injection mechanism