protected override void Context()
        {
            _runResultDTOMapper = A.Fake <IParameterIdentificationRunResultToRunResultDTOMapper>();
            _view = A.Fake <IMultipleParameterIdentificationResultsView>();
            _transferOptimizedParametersToSimulationTask = A.Fake <ITransferOptimizedParametersToSimulationsTask>();
            _commandCollector = A.Fake <ICommandCollector>();

            sut = new MultipleParameterIdentificationResultsPresenter(_view, _runResultDTOMapper, _transferOptimizedParametersToSimulationTask);
            sut.InitializeWith(_commandCollector);


            _parameterIdentification = new ParameterIdentification();
            _runResult1 = A.Fake <ParameterIdentificationRunResult>();
            _runResult2 = A.Fake <ParameterIdentificationRunResult>();
            _parameterIdentification.AddResult(_runResult1);
            _parameterIdentification.AddResult(_runResult2);

            _dto1 = new ParameterIdentificationRunResultDTO(_runResult1);
            _dto2 = new ParameterIdentificationRunResultDTO(_runResult2);

            A.CallTo(() => _runResultDTOMapper.MapFrom(_parameterIdentification, _runResult1)).Returns(_dto1);
            A.CallTo(() => _runResultDTOMapper.MapFrom(_parameterIdentification, _runResult2)).Returns(_dto2);

            A.CallTo(() => _view.BindTo(A <IEnumerable <ParameterIdentificationRunResultDTO> > ._))
            .Invokes(x => _allParameterIdentificationRunResultDTO = x.GetArgument <IEnumerable <ParameterIdentificationRunResultDTO> >(0).ToList());
        }
Ejemplo n.º 2
0
        public void EditParameterIdentification(ParameterIdentification parameterIdentification)
        {
            _parameterIdentification = parameterIdentification;
            _allResultsDTO.Clear();
            parameterIdentification.Results.Each(x => { _allResultsDTO.Add(_runResultDTOMapper.MapFrom(parameterIdentification, x)); });

            _view.BindTo(_allResultsDTO);
        }
Ejemplo n.º 3
0
        public void EditParameterIdentification(ParameterIdentification parameterIdentification)
        {
            _parameterIdentification = parameterIdentification;
            //We expect one result when landing here.

            _result    = parameterIdentification.Results[0];
            _resultDTO = _runResultDTOMapper.MapFrom(parameterIdentification, _result);
            _view.BindTo(_resultDTO);
            _runPropertiesPresenter.Edit(_result);
        }