protected override Task Context()
        {
            _fieldMapper = A.Fake <PopulationAnalysisFieldMapper>();
            sut          = new PopulationAnalysisMapper(_fieldMapper);

            _populationStatisticalAnalysis = new PopulationStatisticalAnalysis();
            _selectedStatisticalAnalysis   = new PredefinedStatisticalAggregation {
                Method = StatisticalAggregationType.Max, Selected = true, LineStyle = LineStyles.Dash
            };
            _populationStatisticalAnalysis.AddStatistic(_selectedStatisticalAnalysis);
            _populationStatisticalAnalysis.AddStatistic(new PredefinedStatisticalAggregation {
                Method = StatisticalAggregationType.Min, Selected = false
            });

            _populationBoxWiskerAnalysis = new PopulationBoxWhiskerAnalysis {
                ShowOutliers = true
            };

            _field1 = A.Fake <IPopulationAnalysisField>().WithName("Field1");
            _field2 = A.Fake <IPopulationAnalysisField>().WithName("Field2");
            _populationPivotAnalysis = new PopulationPivotAnalysis();
            _populationPivotAnalysis.Add(_field1);
            _populationPivotAnalysis.Add(_field2);
            _populationPivotAnalysis.SetPosition(_field1, PivotArea.FilterArea, 1);
            _populationPivotAnalysis.SetPosition(_field2, PivotArea.RowArea, 2);
            _snapshotField1 = new PopulationAnalysisField().WithName(_field1.Name);
            _snapshotField2 = new PopulationAnalysisField().WithName(_field2.Name);

            A.CallTo(() => _fieldMapper.MapToSnapshot(_field1)).Returns(_snapshotField1);
            A.CallTo(() => _fieldMapper.MapToSnapshot(_field2)).Returns(_snapshotField2);
            return(_completed);
        }
        public void SelectionChanged(FieldSelectionDTO dto)
        {
            var targetArea = dto.Selected ? PivotArea.DataArea : PivotArea.FilterArea;

            _populationAnalysis.SetPosition(dto.PopulationAnalysisField, targetArea, indexOf(dto));
            SelectedItemChanged();
            _eventPublisher.PublishEvent(new PopulationAnalysisDataSelectionChangedEvent(_populationAnalysis));
        }
        private void updatePosition(IPopulationAnalysisField field, int index)
        {
            if (field == _nullField)
            {
                return;
            }

            _populationAnalysis.SetPosition(field, PivotArea.DataArea, index);
        }
        protected override void Context()
        {
            base.Context();
            _sourcePivotAnalysis           = new PopulationPivotAnalysis();
            _pkParameterField              = new PopulationAnalysisPKParameterField().WithName("PKParam");
            _pkParameterField.PKParameter  = "AUC";
            _pkParameterField.QuantityPath = "A|B|C";

            _parameterField = new PopulationAnalysisParameterField().WithName("Param");
            _parameterField.ParameterPath = "A|B|C|D";
            _sourcePivotAnalysis.Add(_pkParameterField);
            _sourcePivotAnalysis.Add(_parameterField);
            _sourcePivotAnalysis.SetPosition(_parameterField, PivotArea.DataArea, 1);
            _sourcePivotAnalysis.SetPosition(_pkParameterField, PivotArea.RowArea, 2);
        }
Exemplo n.º 5
0
 private void updateFieldPositionIndex()
 {
     if (_populationAnalysis == null)
     {
         return;
     }
     _allFields.Each((dto, i) => _populationAnalysis.SetPosition(dto.Field, Area, i));
 }
 protected override void Context()
 {
     base.Context();
     _pivotAnalysis  = new PopulationPivotAnalysis();
     _parameterField = new PopulationAnalysisCovariateField().WithName("Param");
     _dataArea       = new PopulationAnalysisParameterField().WithName("OnFilter");
     _pivotAnalysis.Add(_parameterField);
     _pivotAnalysis.Add(_dataArea);
     _pivotAnalysis.SetPosition(_dataArea, PivotArea.DataArea, 0);
 }
 protected override void Context()
 {
     base.Context();
     _pivotAnalysis      = new PopulationPivotAnalysis();
     _parameterField     = new PopulationAnalysisCovariateField().WithName("Param");
     _existingColorField = new PopulationAnalysisCovariateField().WithName("ColorField");
     _filterArea         = new PopulationAnalysisParameterField().WithName("OnFilter");
     _pivotAnalysis.Add(_parameterField);
     _pivotAnalysis.Add(_existingColorField);
     _pivotAnalysis.Add(_filterArea);
     _pivotAnalysis.SetPosition(_filterArea, PivotArea.FilterArea, 0);
     _pivotAnalysis.ColorField = _existingColorField;
 }
        private void fieldsMoved(object sender, FieldsMovedEventArgs e)
        {
            var targetIndex = _populationAnalysis.AllFieldsOn(e.Area).Count - 1;

            if (e.Target != null)
            {
                targetIndex = _populationAnalysis.GetAreaIndex(e.Target);
            }

            foreach (var movedField in e.Fields)
            {
                _populationAnalysis.SetPosition(movedField, e.Area, ++targetIndex);
            }

            if (e.Target != null)
            {
                _populationAnalysis.SetPosition(e.Target, e.Area, ++targetIndex);
            }

            RefreshAnalysis();
            _eventPublisher.PublishEvent(new FieldsMovedInPopulationAnalysisEvent(_populationAnalysis, e.Fields));
        }
 protected override void Because()
 {
     _pivotAnalysis.SetPosition(_parameterField, PivotArea.DataArea);
 }