protected override async Task Context() { await base.Context(); _snapshot = await sut.MapToSnapshot(_populationSimulation, _project); var populationSimulation = new PopulationSimulation { Properties = _simulationProperties, SimulationSettings = _settings, Model = _model }; populationSimulation.AddUsedBuildingBlock(new UsedBuildingBlock("IndTemplateId", PKSimBuildingBlockType.Individual) { BuildingBlock = _individual }); A.CallTo(() => _simulationFactory.CreateFrom(_population, A <IReadOnlyList <Compound> > ._, A <ModelProperties> ._, null)).Returns(populationSimulation); A.CallTo(() => _populationAnalysisChartMapper.MapToModel(_snapshotPopulationAnalysisChart, A <SimulationAnalysisContext> ._)) .Invokes(x => _context = x.GetArgument <SimulationAnalysisContext>(1)) .Returns(_populationSimulationAnalysisChart); _snapshotSimulationContext = new SimulationContext(run: false, new SnapshotContext(_project, 10)); }
protected override async Task Context() { await base.Context(); _simulationAnalysisContext = new SimulationAnalysisContext(new [] { _observedDataRepository, }); _snapshot = await sut.MapToSnapshot(_observedDataCollection); }
protected override async Task Context() { await base.Context(); _context = new SimulationAnalysisContext(); _snapshot = await sut.MapToSnapshot(_bowWiskerChart); var boxWiskerAnalysisChart = new BoxWhiskerAnalysisChart {PopulationAnalysis = new PopulationBoxWhiskerAnalysis()}; A.CallTo(() => _populationAnalysisChartFactory.Create(PopulationAnalysisType.BoxWhisker)).Returns(boxWiskerAnalysisChart); }
protected override async Task Context() { await base.Context(); _snapshot = await sut.MapToSnapshot(_curve); _context = new SimulationAnalysisContext(new[] { _dataRepository }); _newModelCurveOptions = new CurveOptions { Color = Color.Aqua }; A.CallTo(() => _curveOptionsMapper.MapToModel(_snapshot.CurveOptions)).Returns(_newModelCurveOptions); }
protected override async Task Context() { await base.Context(); _snapshot = await sut.MapToSnapshot(_curve); _anotherRepository = DomainHelperForSpecs.ObservedData(); _y2Column = _anotherRepository.AllButBaseGrid().First(); _y2Column.QuantityInfo.Path = new[] { "D", "E", "F" }; _context = new SimulationAnalysisContext(new[] { _dataRepository, _anotherRepository, }); _snapshot.CurveOptions.Color = Color.Aqua; _snapshot.X = _y2Column.PathAsString; }
protected override async Task Context() { await base.Context(); _context = new SimulationAnalysisContext(); _snapshot = await sut.MapToSnapshot(_curveChart); _snapshot.Axes = new[] { _snapshotAxis, }; A.CallTo(() => _axisMapper.MapToModel(_snapshotAxis)).Returns(_axis); A.CallTo(() => _curveMapper.MapToModel(_snapshotCurve, _context)).Returns(_curve); A.CallTo(() => _idGenerator.NewId()).Returns(_newId); }
protected override async Task Context() { await base.Context(); _snapshot = await sut.MapToSnapshot(_curve); _context = new SimulationAnalysisContext(null, new SnapshotContext()) { RunSimulation = false }; _newModelCurveOptions = new CurveOptions { Color = Color.Aqua }; A.CallTo(() => _curveOptionsMapper.MapToModel(_snapshot.CurveOptions, A <SnapshotContext> ._)).Returns(_newModelCurveOptions); }
protected override async Task Context() { await base.Context(); _snapshot = await sut.MapToSnapshot(_individualSimulation, _project); var individualSimulation = new IndividualSimulation { Properties = _simulationProperties, SimulationSettings = _settings, Model = _model }; individualSimulation.AddUsedBuildingBlock(new UsedBuildingBlock("IndTemplateId", PKSimBuildingBlockType.Individual) { Name = _individual.Name, BuildingBlock = _individual }); _modelProperties = new ModelProperties(); A.CallTo(() => _modelPropertiesTask.DefaultFor(_individual.OriginData, _snapshot.Model)).Returns(_modelProperties); A.CallTo(() => _simulationFactory.CreateFrom(_individual, A <IReadOnlyList <Compound> > ._, _modelProperties, null)).Returns(individualSimulation); _outputSelection = new OSPSuite.Core.Domain.OutputSelections(); _outputSelection.AddOutput(new QuantitySelection("PATH", QuantityType.BaseGrid)); A.CallTo(() => _outputSelectionMapper.MapToModel(_snapshot.OutputSelections, individualSimulation)).Returns(_outputSelection); _solver = new SolverSettings(); A.CallTo(() => _solverSettingsMapper.MapToModel(_snapshot.Solver)).Returns(_solver); _outputSchema = new OutputSchema(); A.CallTo(() => _outputSchemaMapper.MapToModel(_snapshot.OutputSchema)).Returns(_outputSchema); A.CallTo(() => _curveChartMapper.MapToModel(_snapshotSimulationTimeProfile, A <SimulationAnalysisContext> ._)) .Invokes(x => _context = x.GetArgument <SimulationAnalysisContext>(1)) .Returns(_simulationTimeProfile); //ensure that run will be performed _snapshot.HasResults = true; _calculatedDataRepository = DomainHelperForSpecs.ObservedData("Calculated"); A.CallTo(() => _simulationRunner.RunSimulation(individualSimulation, A <SimulationRunOptions> ._)) .Invokes(x => { individualSimulation.DataRepository = _calculatedDataRepository; }); A.CallTo(() => _eventMappingMapper.MapToModel(_eventSelection, _project)).Returns(_eventMapping); A.CallTo(() => _observerSetMappingMapper.MapToModel(_observerSetSelection, _project)).Returns(_observerSetMapping); }
protected override async Task Context() { await base.Context(); _snapshot = await sut.MapToSnapshot(_populationSimulation, _project); var populationSimulation = new PopulationSimulation { Properties = _simulationProperties, SimulationSettings = _settings, Model = _model }; A.CallTo(() => _simulationFactory.CreateFrom(_population, A <IReadOnlyList <Compound> > ._, A <ModelProperties> ._, null)).Returns(populationSimulation); A.CallTo(() => _populationAnalysisChartMapper.MapToModel(_snapshotPopulationAnalysisChart, A <SimulationAnalysisContext> ._)) .Invokes(x => _context = x.GetArgument <SimulationAnalysisContext>(1)) .Returns(_populationSimulationAnalysisChart); }