protected override void Context()
        {
            _view = A.Fake <IPopulationAnalysisFieldsView>();
            _contextMenuFactory             = A.Fake <IPopulationAnalysesContextMenuFactory>();
            _populationAnalysisFieldFactory = A.Fake <IPopulationAnalysisFieldFactory>();
            _eventPublisher = A.Fake <IEventPublisher>();
            _populationAnalysisGroupingFieldCreator = A.Fake <IPopulationAnalysisGroupingFieldCreator>();
            _populationAnalysisTemplateTask         = A.Fake <IPopulationAnalysisTemplateTask>();
            _dialogCreator  = A.Fake <IDialogCreator>();
            _fieldDTOMapper = A.Fake <IPopulationAnalysisFieldToPopulationAnalysisFieldDTOMapper>();
            sut             = new PopulationAnalysisOutputFieldsPresenter(_view, _contextMenuFactory, _populationAnalysisFieldFactory, _eventPublisher, _populationAnalysisGroupingFieldCreator, _populationAnalysisTemplateTask, _dialogCreator, _fieldDTOMapper);

            A.CallTo(() => _view.SelectedField).Returns(null);
            _populationDataCollector = A.Fake <IPopulationDataCollector>();
            _populationAnalysis      = new PopulationPivotAnalysis();
            sut.StartAnalysis(_populationDataCollector, _populationAnalysis);

            _dimension1 = DomainHelperForSpecs.ConcentrationDimensionForSpecs();
            _dimension2 = DomainHelperForSpecs.LengthDimensionForSpecs();

            A.CallTo(() => _populationAnalysisFieldFactory.CreateFor(A <IQuantity> ._, A <string> ._))
            .ReturnsLazily(s => new PopulationAnalysisOutputField {
                Dimension = s.Arguments[0].DowncastTo <IQuantity>().Dimension, Name = s.Arguments[1].ToString()
            });
        }
        protected override void Context()
        {
            _view = A.Fake <IPopulationAnalysisFieldsView>();
            _quantitiesRetriever            = A.Fake <IEntitiesInContainerRetriever>();
            _contextMenuFactory             = A.Fake <IPopulationAnalysesContextMenuFactory>();
            _populationAnalysisFieldFactory = A.Fake <IPopulationAnalysisFieldFactory>();
            _populationAnalysisTemplateTask = A.Fake <IPopulationAnalysisTemplateTask>();
            _dialogCreator  = A.Fake <IDialogCreator>();
            _fieldDTOMapper = A.Fake <IPopulationAnalysisFieldToPopulationAnalysisFieldDTOMapper>();
            _parameterCache = new PathCacheForSpecs <IParameter>();
            _eventPublisher = A.Fake <IEventPublisher>();
            _populationAnalysisGroupingFieldCreator = A.Fake <IPopulationAnalysisGroupingFieldCreator>();
            sut = new PopulationAnalysisParameterFieldsPresenter(_view, _contextMenuFactory, _quantitiesRetriever, _populationAnalysisFieldFactory,
                                                                 _eventPublisher, _populationAnalysisGroupingFieldCreator, _populationAnalysisTemplateTask, _dialogCreator, _fieldDTOMapper);

            A.CallTo(_quantitiesRetriever).WithReturnType <PathCache <IParameter> >().Returns(_parameterCache);
            _populationPivotAnalysis = new PopulationPivotAnalysis();
            _populationDataCollector = A.Fake <IPopulationDataCollector>();
            sut.StartAnalysis(_populationDataCollector, _populationPivotAnalysis);

            _parameter      = A.Fake <IParameter>();
            _parameterField = new PopulationAnalysisParameterField {
                ParameterPath = _parameterPath, Name = "ParameterField"
            };
            A.CallTo(() => _populationAnalysisFieldFactory.CreateFor(_parameter)).Returns(_parameterField);

            _derivedField = A.Fake <PopulationAnalysisDerivedField>();
            A.CallTo(() => _derivedField.ReferencedFieldNames).Returns(new[] { _parameterField.Name });

            _parameterCache.Add(_parameterPath, _parameter);
        }
 protected PopulationAnalysisFieldsPresenter(IPopulationAnalysisFieldsView view, IReadOnlyList <Type> fieldTypes, IPopulationAnalysesContextMenuFactory contextMenuFactory,
                                             IPopulationAnalysisFieldFactory populationAnalysisFieldFactory, IEventPublisher eventPublisher, IPopulationAnalysisGroupingFieldCreator populationAnalysisGroupingFieldCreator,
                                             IPopulationAnalysisTemplateTask populationAnalysisTemplateTask, IDialogCreator dialogCreator, IPopulationAnalysisFieldToPopulationAnalysisFieldDTOMapper fieldDTOMapper)
     : base(view)
 {
     _fieldTypes                             = fieldTypes;
     _contextMenuFactory                     = contextMenuFactory;
     _populationAnalysisFieldFactory         = populationAnalysisFieldFactory;
     _eventPublisher                         = eventPublisher;
     _populationAnalysisGroupingFieldCreator = populationAnalysisGroupingFieldCreator;
     _populationAnalysisTemplateTask         = populationAnalysisTemplateTask;
     _dialogCreator                          = dialogCreator;
     _fieldDTOMapper                         = fieldDTOMapper;
     view.ColorSelectionVisible              = false;
     view.CreateGroupingButtonVisible        = true;
     EmptySelectionMessage                   = PKSimConstants.UI.ChooseFieldsToDisplay;
 }
 public PopulationAnalysisOutputFieldsPresenter(IPopulationAnalysisFieldsView view, IPopulationAnalysesContextMenuFactory contextMenuFactory, IPopulationAnalysisFieldFactory populationAnalysisFieldFactory, IEventPublisher eventPublisher, IPopulationAnalysisGroupingFieldCreator populationAnalysisGroupingFieldCreator, IPopulationAnalysisTemplateTask populationAnalysisTemplateTask, IDialogCreator dialogCreator, IPopulationAnalysisFieldToPopulationAnalysisFieldDTOMapper fieldDTOMapper)
     : base(view, new[] { typeof(PopulationAnalysisOutputField) }, contextMenuFactory, populationAnalysisFieldFactory, eventPublisher, populationAnalysisGroupingFieldCreator, populationAnalysisTemplateTask, dialogCreator, fieldDTOMapper)
 {
     view.ColorSelectionVisible       = true;
     view.CreateGroupingButtonVisible = false;
     EmptySelectionMessage            = PKSimConstants.UI.ChooseOutputsToDisplay;
 }
Exemple #5
0
 public PopulationAnalysisParameterFieldsPresenter(IPopulationAnalysisFieldsView view, IPopulationAnalysesContextMenuFactory contextMenuFactory, IEntitiesInContainerRetriever parametersRetriever, IPopulationAnalysisFieldFactory populationAnalysisFieldFactory, IEventPublisher eventPublisher, IPopulationAnalysisGroupingFieldCreator populationAnalysisGroupingFieldCreator, IPopulationAnalysisTemplateTask populationAnalysisTemplateTask, IDialogCreator dialogCreator, IPopulationAnalysisFieldToPopulationAnalysisFieldDTOMapper fieldDTOMapper)
     : base(view, new[] { typeof(PopulationAnalysisParameterField), typeof(PopulationAnalysisCovariateField) }, contextMenuFactory, populationAnalysisFieldFactory, eventPublisher, populationAnalysisGroupingFieldCreator, populationAnalysisTemplateTask, dialogCreator, fieldDTOMapper)
 {
     _parametersRetriever  = parametersRetriever;
     EmptySelectionMessage = PKSimConstants.UI.ChooseParametersToDisplay;
 }