Example #1
0
        protected override void Context()
        {
            _view = A.Fake <ISimulationModelSelectionView>();
            _categoryCalculationMethodDTOMapper = A.Fake <ICalculationMethodToCategoryCalculationMethodDTOMapper>();
            _modelPropertiesTask          = A.Fake <IModelPropertiesTask>();
            _modelConfigurationRepository = A.Fake <IModelConfigurationRepository>();
            _modelPropertiesMapper        = A.Fake <IModelConfigurationDTOToModelPropertiesMapper>();
            _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();

            _simulation                         = A.Fake <Simulation>();
            _species                            = A.Fake <Species>();
            _individual                         = A.Fake <Individual>();
            _modelProperties                    = A.Fake <ModelProperties>();
            _modelConfiguration                 = A.Fake <ModelConfiguration>();
            _modelConfiguration.ModelName       = "4Comp";
            _originData                         = new OriginData();
            _modelProperties.ModelConfiguration = _modelConfiguration;
            _simulation.ModelProperties         = _modelProperties;
            _simulation.ModelConfiguration      = _modelConfiguration;
            A.CallTo(() => _simulation.BuildingBlock <ISimulationSubject>()).Returns(_individual);
            _individual.OriginData = _originData;
            _originData.Species    = _species;
            A.CallTo(() => _modelPropertiesTask.Update(A <ModelProperties> ._, A <ModelProperties> ._, _originData)).Returns(_modelProperties);

            sut = new SimulationModelSelectionPresenter(_view, _modelConfigurationRepository, _modelPropertiesTask, _modelPropertiesMapper, _representationInfoRepository, _categoryCalculationMethodDTOMapper);
        }
Example #2
0
 public void ModelSelectionChanging(ModelConfiguration newModelConfiguration)
 {
     ModelConfiguration    = newModelConfiguration;
     _modelPropertiesToUse = _modelPropertiesTask.Update(ModelProperties, _modelPropertiesTask.DefaultFor(newModelConfiguration, _originData), _originData);
 }