I have to use a specific constructor with auto fixture customization. The application logic requires to change the temperature unit through the constructor. Otherwise the temperature values will be converted and i can't determine the minimum temperature. Is it possible to modify the used constructor parameter?
Update
This seems to be a work around for me:
var tempUnit = new Fixture().Create<TemperatureUnit>();
var temperatureFixture = new Fixture();
//...
temperatureFixture.Customizations.Add(new RandomNumericSequenceGenerator(Convert.ToInt64(GetMinTemperatureForUnit(tempUnit)), long.MaxValue));
//workaround to force autofixture to create weather with unit
weatherFixture.Register<TemperatureUnit>(() => tempUnit);
weatherFixture.Customize<Weather>(weather => weather.FromFactory(new MethodInvoker(new GreedyConstructorQuery()))
.With(x => x.Temperature, temperatureFixture.Create<double>())
.Without(x => x.TempUnit)