protected override void Context() { _optimizationAlgorithm1 = A.Fake <IOptimizationAlgorithm>(); _optimizationAlgorithm2 = A.Fake <IOptimizationAlgorithm>(); A.CallTo(() => _optimizationAlgorithm2.Name).Returns(Constants.OptimizationAlgorithm.DEFAULT); _identificationAlgorithm1 = A.Fake <OptimizationAlgorithmProperties>(); _identificationAlgorithm2 = A.Fake <OptimizationAlgorithmProperties>(); _algorithmPropertiesMapper = A.Fake <IOptimizationAlgorithmToOptimizationAlgorithmPropertiesMapper>(); _parameterIdentificationConfigurationDTOMapper = A.Fake <IParameterIdentificationConfigurationToParameterIdentificationConfigurationDTOMapper>(); _optimizationAlgorithmRepository = A.Fake <IOptimizationAlgorithmRepository>(); _parameterIdentificationAlgorithmOptionsPresenter = A.Fake <IExtendedPropertiesPresenter>(); _view = A.Fake <IParameterIdentificationConfigurationView>(); _parameterIdentification = new ParameterIdentification(); _noOptionsPresenter = A.Fake <IStandardParameterIdentificationRunModePresenter>(); _multipleParameterIdentificationRunModePresenter = A.Fake <IMultipleParameterIdentificationRunModePresenter>(); _categorialParameterIdentificationRunModePresenter = A.Fake <ICategorialParameterIdentificationRunModePresenter>(); ConfigureCategorialParameterIdentificationRunModePresenter(); sut = new ParameterIdentificationConfigurationPresenter(_view, _parameterIdentificationAlgorithmOptionsPresenter, _optimizationAlgorithmRepository, _parameterIdentificationConfigurationDTOMapper, _algorithmPropertiesMapper, _noOptionsPresenter, _multipleParameterIdentificationRunModePresenter, _categorialParameterIdentificationRunModePresenter); A.CallTo(() => _algorithmPropertiesMapper.MapFrom(_optimizationAlgorithm1)).Returns(_identificationAlgorithm1); A.CallTo(() => _algorithmPropertiesMapper.MapFrom(_optimizationAlgorithm2)).Returns(_identificationAlgorithm2); A.CallTo(() => _noOptionsPresenter.CanEdit(A <ParameterIdentification> .That.Matches(x => x.Configuration.RunMode.IsAnImplementationOf <StandardParameterIdentificationRunMode>()))).Returns(true); A.CallTo(() => _categorialParameterIdentificationRunModePresenter.CanEdit(A <ParameterIdentification> .That.Matches(x => x.Configuration.RunMode.IsAnImplementationOf <CategorialParameterIdentificationRunMode>()))).Returns(true); A.CallTo(() => _multipleParameterIdentificationRunModePresenter.CanEdit(A <ParameterIdentification> .That.Matches(x => x.Configuration.RunMode.IsAnImplementationOf <MultipleParameterIdentificationRunMode>()))).Returns(true); }
public ParameterIdentificationConfigurationPresenter(IParameterIdentificationConfigurationView view, IExtendedPropertiesPresenter algorithmOptionsPresenter, IOptimizationAlgorithmRepository optimizationAlgorithmRepository, IParameterIdentificationConfigurationToParameterIdentificationConfigurationDTOMapper configurationToConfigurationDTOMapper, IOptimizationAlgorithmToOptimizationAlgorithmPropertiesMapper optimizationAlgorithmToAlgorithmMapper, IStandardParameterIdentificationRunModePresenter standardRunModePresenter, IMultipleParameterIdentificationRunModePresenter multipleRunModePresenter, ICategorialParameterIdentificationRunModePresenter categorialRunModePresenter) : base(view) { _algorithmOptionsPresenter = algorithmOptionsPresenter; _configurationToConfigurationDTOMapper = configurationToConfigurationDTOMapper; _optimizationAlgorithmToAlgorithmMapper = optimizationAlgorithmToAlgorithmMapper; AddSubPresenters(_algorithmOptionsPresenter, standardRunModePresenter, multipleRunModePresenter, categorialRunModePresenter); _view.AddAlgorithmOptionsView(_algorithmOptionsPresenter.View); Algorithms = optimizationAlgorithmRepository.All().ToList(); _allRunModePresenters = new List <IParameterIdentificationRunModePresenter> { standardRunModePresenter, multipleRunModePresenter }; if (categorialRunModePresenter.HasCategories) { _allRunModePresenters.Add(categorialRunModePresenter); } }