protected override void Context()
        {
            _cloneManager               = A.Fake <ICloneManagerForModel>();
            _simulationFactory          = A.Fake <ICoreSimulationFactory>();
            _parameterIdentificationRun = A.Fake <IParameterIdentificationRun>();
            _coreUserSettings           = A.Fake <ICoreUserSettings>();
            _descriptionCreator         = A.Fake <ICategorialParameterIdentificationDescriptionCreator>();
            _container = A.Fake <Utility.Container.IContainer>();
            A.CallTo(() => _container.Resolve <ICoreSimulationFactory>()).Returns(_simulationFactory);
            _coreUserSettings.MaximumNumberOfCoresToUse = 1;
            sut = new CategorialParameterIdentificationRunInitializer(_cloneManager, _parameterIdentificationRun, _container, _descriptionCreator, _coreUserSettings);

            _parameterIdentification = new ParameterIdentification();
            _parameterIdentification.Configuration.RunMode = new CategorialParameterIdentificationRunMode();

            _simulation       = A.Fake <ISimulation>();
            _clonedSimulation = A.Fake <ISimulation>();

            A.CallTo(() => _simulationFactory.CreateWithCalculationMethodsFrom(_simulation, A <IEnumerable <CalculationMethodWithCompoundName> > ._)).Returns(_clonedSimulation);
            A.CallTo(() => _cloneManager.Clone(_parameterIdentification)).ReturnsLazily(() =>
            {
                var pi = new ParameterIdentification();
                pi.AddSimulation(_simulation);
                var identificationParameter = new IdentificationParameter();
                identificationParameter.AddLinkedParameter(new ParameterSelection(_simulation, A.Fake <QuantitySelection>()));
                pi.AddIdentificationParameter(identificationParameter);
                pi.AddOutputMapping(new OutputMapping
                {
                    OutputSelection = new SimulationQuantitySelection(_simulation, A.Fake <QuantitySelection>())
                });
                pi.Configuration.RunMode = new CategorialParameterIdentificationRunMode();
                return(pi);
            });
        }
Example #2
0
 public CategorialParameterIdentificationRunInitializer(ICloneManagerForModel cloneManager, IParameterIdentificationRun parameterIdentificationRun, ICoreSimulationFactory simulationFactory, ICategorialParameterIdentificationDescriptionCreator descriptionCreator) : base(cloneManager, parameterIdentificationRun)
 {
     _simulationFactory  = simulationFactory;
     _descriptionCreator = descriptionCreator;
 }