Beispiel #1
0
 protected override void Context()
 {
     base.Context();
     _comparison = new PopulationSimulationComparison();
     _sim1       = A.Fake <PopulationSimulation>().WithId("Sim1");
     _sim2       = A.Fake <PopulationSimulation>().WithId("Sim2");
     _comparison.AddSimulation(_sim1);
     _comparison.AddSimulation(_sim2);
 }
        protected override Task Context()
        {
            _individualSimulationComparisonMapper = A.Fake <IndividualSimulationComparisonMapper>();
            _populationAnalysisChartMapper        = A.Fake <PopulationAnalysisChartMapper>();
            _objectBaseFactory = A.Fake <IObjectBaseFactory>();
            sut = new SimulationComparisonMapper(_individualSimulationComparisonMapper, _populationAnalysisChartMapper, _objectBaseFactory);

            _individualSimulation1 = new IndividualSimulation().WithName("IndS1").WithId("IndS1");
            _individualSimulation2 = new IndividualSimulation().WithName("IndS2").WithId("IndS2");

            _individualSimulationComparison = new IndividualSimulationComparison
            {
                Name        = "IndividualComparison",
                Description = "IndividualComparison Description",
            };

            _individualSimulationComparison.AddSimulation(_individualSimulation1);
            _individualSimulationComparison.AddSimulation(_individualSimulation2);


            _populationSimulation1 = new PopulationSimulation().WithName("PopS1").WithId("PopS1");
            _populationSimulation2 = new PopulationSimulation().WithName("PopS2").WithId("PopS2");
            _referenceSimulation   = new PopulationSimulation().WithName("PopS3").WithId("PopS3");

            _populationSimulationComparison = new PopulationSimulationComparison
            {
                Name        = "PopulationComparison",
                Description = "PopulationComparison Description",
            };

            _populationSimulationAnalysis = new BoxWhiskerAnalysisChart();
            _populationSimulationComparison.AddSimulation(_populationSimulation1);
            _populationSimulationComparison.AddSimulation(_populationSimulation2);
            _populationSimulationComparison.AddAnalysis(_populationSimulationAnalysis);

            _populationSimulationComparison.ReferenceGroupingItem = new GroupingItem();
            _populationSimulationComparison.ReferenceSimulation   = _referenceSimulation;

            _curveChart = new CurveChart();
            A.CallTo(() => _individualSimulationComparisonMapper.MapToSnapshot(_individualSimulationComparison)).Returns(_curveChart);

            _populationAnalysisChartSnapshot = new Snapshots.PopulationAnalysisChart();
            A.CallTo(() => _populationAnalysisChartMapper.MapToSnapshot(_populationSimulationAnalysis)).Returns(_populationAnalysisChartSnapshot);


            _project = new PKSimProject();
            _project.AddBuildingBlock(_individualSimulation1);
            _project.AddBuildingBlock(_individualSimulation2);
            _project.AddBuildingBlock(_populationSimulation1);
            _project.AddBuildingBlock(_populationSimulation2);
            _project.AddBuildingBlock(_referenceSimulation);

            _snapshotContext = new SnapshotContext(_project, ProjectVersions.V10);
            return(_completed);
        }
Beispiel #3
0
        public bool Edit(PopulationSimulationComparison simulationComparison)
        {
            updateSelectionFromComparison(simulationComparison);

            _view.BindTo(_selectionDTO);
            ViewChanged();
            _view.Display();

            if (_view.Canceled)
            {
                return(false);
            }

            simulationComparison.RemoveAllSimulations();
            selectedSimulations.Each(s =>
            {
                _lazyLoadTask.Load(s);
                simulationComparison.AddSimulation(s);
            });

            //add reference settings
            simulationComparison.ReferenceSimulation   = referenceSimulation;
            simulationComparison.ReferenceGroupingItem = referenceGroupingItem;

            return(true);
        }