public SimulationCompoundProtocolFormulationPresenter(ISimulationCompoundProtocolFormulationView view, IFormulationTask formulationTask, IFormulationMappingDTOToFormulationMappingMapper formulationMappingMapper, IFormulationFromMappingRetriever formulationFromMappingRetriever, IBuildingBlockSelectionDisplayer buildingBlockSelectionDisplayer) : base(view) { _formulationTask = formulationTask; _formulationMappingMapper = formulationMappingMapper; _formulationFromMappingRetriever = formulationFromMappingRetriever; _buildingBlockSelectionDisplayer = buildingBlockSelectionDisplayer; }
public SimulationCompoundsSelectionPresenter(ISimulationCompoundsSelectionView view, IBuildingBlockRepository buildingBlockRepository, IBuildingBlockInSimulationManager buildingBlockInSimulationManager, ICompoundTask compoundTask, IBuildingBlockSelectionDisplayer buildingBlockSelectionDisplayer) : base(view) { _buildingBlockRepository = buildingBlockRepository; _buildingBlockInSimulationManager = buildingBlockInSimulationManager; _compoundTask = compoundTask; _buildingBlockSelectionDisplayer = buildingBlockSelectionDisplayer; _compoundSelectionDTOs = new NotifyList <CompoundSelectionDTO>(); _view.BindTo(_compoundSelectionDTOs); _compoundSelectionDTOs.CollectionChanged += onCollectionChanged; }
public SimulationObserversConfigurationPresenter( ISimulationObserversConfigurationView view, IObserverSetMappingToObserverSetMappingDTOMapper observerSetMappingDTOMapper, IObserverSetTask observerSetTask, ISimulationBuildingBlockUpdater simulationBuildingBlockUpdater, IBuildingBlockSelectionDisplayer buildingBlockSelectionDisplayer ) : base(view) { _observerSetMappingDTOMapper = observerSetMappingDTOMapper; _observerSetTask = observerSetTask; _simulationBuildingBlockUpdater = simulationBuildingBlockUpdater; _buildingBlockSelectionDisplayer = buildingBlockSelectionDisplayer; }
public BuildingBlockSelectionPresenter(IBuildingBlockSelectionView view, IObjectTypeResolver objectTypeResolver, IBuildingBlockRepository buildingBlockRepository, IContainer container, IObjectBaseFactory objectBaseFactory, IBuildingBlockSelectionDisplayer buildingBlockSelectionDisplayer) : base(view) { _buildingBlockRepository = buildingBlockRepository; _container = container; _buildingBlockSelectionDisplayer = buildingBlockSelectionDisplayer; BuildingBlockType = objectTypeResolver.TypeFor <TBuildingBlock>(); _buildingBlockDTO = new BuildingBlockSelectionDTO { BuildingBockType = BuildingBlockType }; _view.DisplayIcons = true; _emptySelection = objectBaseFactory.Create <TBuildingBlock>().WithName(PKSimConstants.UI.None); }
protected override void Context() { _compoundTask = A.Fake <ICompoundTask>(); _view = A.Fake <ISimulationCompoundsSelectionView>(); _buildingBlockRepository = A.Fake <IBuildingBlockRepository>(); _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>(); _buildingBlockSelectionDisplayer = A.Fake <IBuildingBlockSelectionDisplayer>(); A.CallTo(() => _buildingBlockRepository.All <Compound>()).Returns(_allCompoundTemplates); A.CallTo(() => _view.BindTo(A <NotifyList <CompoundSelectionDTO> > ._)) .Invokes(x => _compoundDTOList = x.GetArgument <NotifyList <CompoundSelectionDTO> >(0)); sut = new SimulationCompoundsSelectionPresenter(_view, _buildingBlockRepository, _buildingBlockInSimulationManager, _compoundTask, _buildingBlockSelectionDisplayer); sut.Initialize(); CompoundSelectionDTOFor(_compound1).Selected = true; }
protected override void Context() { _individualList = new List <Individual>(); _individualBuildingBlockTask = A.Fake <IBuildingBlockTask <Individual> >(); _container = A.Fake <IContainer>(); A.CallTo(() => _container.Resolve <IBuildingBlockTask <Individual> >()).Returns(_individualBuildingBlockTask); _view = A.Fake <IBuildingBlockSelectionView>(); _objectTypeResolver = A.Fake <IObjectTypeResolver>(); _individualRepository = A.Fake <IBuildingBlockRepository>(); A.CallTo(() => _individualRepository.All <Individual>()).Returns(_individualList); _buildingBlockType = "Tralal"; A.CallTo(() => _objectTypeResolver.TypeFor <Individual>()).Returns(_buildingBlockType); _toolTipCreator = A.Fake <IToolTipPartCreator>(); _buildingBlockSelection = A.Fake <IBuildingBlockSelectionDisplayer>(); _objectBaseFactory = A.Fake <IObjectBaseFactory>(); _emptySelection = new Individual().WithId("TOTO"); A.CallTo(() => _objectBaseFactory.Create <Individual>()).Returns(_emptySelection); sut = new BuildingBlockSelectionPresenter <Individual>(_view, _objectTypeResolver, _individualRepository, _container, _objectBaseFactory, _buildingBlockSelection); }
protected override void Context() { _view = A.Fake <ISimulationCompoundProtocolFormulationView>(); _formulationTask = A.Fake <IFormulationTask>(); _formulationMappingMapper = A.Fake <IFormulationMappingDTOToFormulationMappingMapper>(); _formulationFromMappingRetriever = A.Fake <IFormulationFromMappingRetriever>(); _formulation1 = new Formulation(); _formulation2 = new Formulation(); _protocol = A.Fake <Protocol>(); _compound = A.Fake <Compound>(); _simulation = A.Fake <Simulation>(); _protocolProperties = A.Fake <ProtocolProperties>(); var compoundProperties = new CompoundProperties(); A.CallTo(() => _simulation.CompoundPropertiesFor(_compound)).Returns(compoundProperties); compoundProperties.ProtocolProperties = _protocolProperties; _protocolProperties.Protocol = _protocol; A.CallTo(() => _formulationTask.All()).Returns(new[] { _formulation1, _formulation2 }); _buildingBlockSelectionDisplayer = A.Fake <IBuildingBlockSelectionDisplayer>(); sut = new SimulationCompoundProtocolFormulationPresenter(_view, _formulationTask, _formulationMappingMapper, _formulationFromMappingRetriever, _buildingBlockSelectionDisplayer); }
protected override void Context() { _view = A.Fake <ISimulationObserversConfigurationView>(); _observerSetDTOMapper = A.Fake <IObserverSetMappingToObserverSetMappingDTOMapper>(); _observerSetTask = A.Fake <IObserverSetTask>(); _simulationBuildingBlockUpdater = A.Fake <ISimulationBuildingBlockUpdater>(); _buildingBlockSelectionDisplayer = A.Fake <IBuildingBlockSelectionDisplayer>(); sut = new SimulationObserversConfigurationPresenter(_view, _observerSetDTOMapper, _observerSetTask, _simulationBuildingBlockUpdater, _buildingBlockSelectionDisplayer); _observerSetMapping = new ObserverSetMapping { TemplateObserverSetId = TEMPLATE_OBSERVER_SET_ID_1 }; _observerSetProperties = new ObserverSetProperties(); _observerSetProperties.AddObserverSetMapping(_observerSetMapping); _simulation = new IndividualSimulation { Properties = new SimulationProperties { ObserverSetProperties = _observerSetProperties } }; _observerSetTemplate1 = new ObserverSet().WithName("OBSERVER_SET_1").WithId(TEMPLATE_OBSERVER_SET_ID_1); _observerSetTemplate2 = new ObserverSet().WithName("ANOTER_OBSERVER_SET_2").WithId(TEMPLATE_OBSERVER_SET_ID_2); A.CallTo(() => _observerSetTask.All()).Returns(new[] { _observerSetTemplate1, _observerSetTemplate2 }); _observerSetMappingDTO = new ObserverSetMappingDTO(_observerSetMapping) { ObserverSet = _observerSetTemplate1 }; A.CallTo(() => _observerSetDTOMapper.MapFrom(_observerSetMapping, _simulation)).Returns(_observerSetMappingDTO); A.CallTo(() => _view.BindTo(A <IEnumerable <ObserverSetMappingDTO> > ._)) .Invokes(x => _allObserverSetMappingDTO = x.GetArgument <IEnumerable <ObserverSetMappingDTO> >(0)); sut.EditSimulation(_simulation, CreationMode.New); }