Esempio n. 1
0
 public override void Edit(ParameterIdentification parameterIdentification)
 {
     base.Edit(parameterIdentification);
     this.DoWithinLatch(() =>
     {
         _runModeDTO = _categorialDTOMapper.MapFrom(_runMode, _allCategoriesDTO, _parameterIdentification.AllSimulations);
         _view.BindTo(_runModeDTO);
     });
     updateOptimizationCount();
 }
        protected override void Context()
        {
            _view = A.Fake <ICategorialParameterIdentificationRunModeView>();
            _categorialDTOMapper   = A.Fake <ICategorialRunModeToCategorialRunModeDTOMapper>();
            _categoryDTORepository = A.Fake <ICategoryDTORepository>();
            _categorialToCalculationMethodPermutationMapper = A.Fake <ICategorialParameterIdentificationToCalculationMethodPermutationMapper>();
            sut = new CategorialParameterIdentificationRunModePresenter(_view, _categorialDTOMapper, _categorialToCalculationMethodPermutationMapper, _categoryDTORepository);

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

            A.CallTo(() => _view.BindTo(A <CategorialRunModeDTO> ._))
            .Invokes(x => _dto = x.GetArgument <CategorialRunModeDTO>(0));

            A.CallTo(() => _categorialDTOMapper.MapFrom(_runMode, A <IReadOnlyList <CategoryDTO> > ._, _parameterIdentification.AllSimulations))
            .Returns(new CategorialRunModeDTO(_runMode));

            A.CallTo(() => _view.BindTo(A <CategorialRunModeDTO> ._))
            .Invokes(x => _dto = x.GetArgument <CategorialRunModeDTO>(0));
        }