protected override async Task Context() { await base.Context(); _parameterIdentification = new ParameterIdentification().WithName("PI"); _qualificationStep = new RunParameterIdentificationQualificationStep { ParameterIdentification = _parameterIdentification }; }
protected override async Task Context() { await base.Context(); _parameterIdentification = new ParameterIdentification().WithName("PI"); _qualificationStep = new RunParameterIdentificationQualificationStep { ParameterIdentification = _parameterIdentification }; _snapshot = await sut.MapToSnapshot(_qualificationStep); _project.AddParameterIdentification(_parameterIdentification); }
protected override Task Context() { _parameterIdentificationConfigurationMapper = A.Fake <ParameterIdentificationConfigurationMapper>(); _outputMappingMapper = A.Fake <OutputMappingMapper>(); _identificationParameterMapper = A.Fake <IdentificationParameterMapper>(); _parameterIdentificationAnalysisMapper = A.Fake <ParameterIdentificationAnalysisMapper>(); _objectBaseFactory = A.Fake <IObjectBaseFactory>(); _logger = A.Fake <IOSPSuiteLogger>(); _project = new PKSimProject(); _snapshotContext = new SnapshotContext(_project, ProjectVersions.Current); _simulation = new IndividualSimulation().WithName("S1"); _project.AddBuildingBlock(_simulation); _parameterIdentification = new ModelParameterIdentification(); _snapshotParameterIndentificationConfiguration = new ParameterIdentificationConfiguration(); _snapshotOutputMapping = new Snapshots.OutputMapping(); _outputMapping = new OutputMapping(); _parameterIdentification.AddSimulation(_simulation); _parameterIdentification.AddOutputMapping(_outputMapping); _identificationParameter = new IdentificationParameter { Name = "IP" }; _parameterIdentification.AddIdentificationParameter(_identificationParameter); _snapshotIdentificationParameter = new Snapshots.IdentificationParameter(); _snapshotParameterIdentificationAnalysis = new ParameterIdentificationAnalysis(); _parameterIdentificationAnalysis = A.Fake <ISimulationAnalysis>(); _parameterIdentification.AddAnalysis(_parameterIdentificationAnalysis); sut = new ParameterIdentificationMapper( _parameterIdentificationConfigurationMapper, _outputMappingMapper, _identificationParameterMapper, _parameterIdentificationAnalysisMapper, _objectBaseFactory, _logger ); A.CallTo(() => _parameterIdentificationConfigurationMapper.MapToSnapshot(_parameterIdentification.Configuration)).Returns(_snapshotParameterIndentificationConfiguration); A.CallTo(() => _outputMappingMapper.MapToSnapshot(_outputMapping)).Returns(_snapshotOutputMapping); A.CallTo(() => _identificationParameterMapper.MapToSnapshot(_identificationParameter)).Returns(_snapshotIdentificationParameter); A.CallTo(() => _parameterIdentificationAnalysisMapper.MapToSnapshot(_parameterIdentificationAnalysis)).Returns(_snapshotParameterIdentificationAnalysis); return(_completed); }
protected override Task Context() { _parameterIdentificationAnalysisChartMapper = A.Fake <ParameterIdentificationAnalysisChartMapper>(); _dataRepositoryMapper = A.Fake <DataRepositoryMapper>(); _idGenerator = A.Fake <IIdGenerator>(); sut = new ParameterIdentificationAnalysisMapper(_parameterIdentificationAnalysisChartMapper, _dataRepositoryMapper, _idGenerator); _parameterIdentificationAnalysis = new T().WithName("Chart"); _chartSnapshot = new CurveChart(); _localRepository = DomainHelperForSpecs.ObservedData(); _snapshotLocalRepository = new Snapshots.DataRepository(); A.CallTo(() => _dataRepositoryMapper.MapToSnapshot(_localRepository)).Returns(_snapshotLocalRepository); _parameterIdentification = new ParameterIdentification(); _project = new PKSimProject(); _parameterIdentificationContext = new ParameterIdentificationContext(_parameterIdentification, _project); return(_completed); }
protected override async Task Because() { _newParameterIdentification = await sut.MapToModel(_snapshot, _context); }
protected override Task Context() { _classificationMapper = A.Fake <ClassificationMapper>(); _snapshotMapper = A.Fake <ISnapshotMapper>(); _executionContext = A.Fake <IExecutionContext>(); _lazyLoadTask = A.Fake <ILazyLoadTask>(); _simulationMapper = A.Fake <SimulationMapper>(); _simulationComparisonMapper = A.Fake <SimulationComparisonMapper>(); _parameterIdentificationMapper = A.Fake <ParameterIdentificationMapper>(); _classificationSnapshotTask = A.Fake <IClassificationSnapshotTask>(); _qualificationPlanMapper = A.Fake <QualificationPlanMapper>(); _creationMetaDataFactory = A.Fake <ICreationMetaDataFactory>(); _logger = A.Fake <ILogger>(); sut = new ProjectMapper( _simulationMapper, _simulationComparisonMapper, _parameterIdentificationMapper, _qualificationPlanMapper, _executionContext, _classificationSnapshotTask, _lazyLoadTask, _creationMetaDataFactory, _logger); A.CallTo(() => _executionContext.Resolve <ISnapshotMapper>()).Returns(_snapshotMapper); _individual = new Individual().WithName("IND"); _compound = new Compound().WithName("COMP"); _event = new PKSimEvent().WithName("EVENT"); _formulation = new Formulation().WithName("FORM"); _protocol = new SimpleProtocol().WithName("PROTO"); _population = new RandomPopulation().WithName("POP"); _observedData = new DataRepository().WithName("OD"); _parameterIdentification = new OSPSuite.Core.Domain.ParameterIdentifications.ParameterIdentification().WithName("PI").WithId("PI_ID"); _classifiableObservedData = new ClassifiableObservedData { Subject = _observedData }; _classification = new Classification { ClassificationType = ClassificationType.ObservedData }.WithName("OD Classification"); _simulationComparison = new IndividualSimulationComparison().WithName("COMP").WithId("SimComp"); _simulation = new IndividualSimulation().WithName("IND_SIM").WithId("IndSim"); _qualificationPlan = new QualificationPlan().WithName("QP").WithId("QP_ID"); _project = new PKSimProject(); _project.AddBuildingBlock(_individual); _project.AddBuildingBlock(_compound); _project.AddBuildingBlock(_event); _project.AddBuildingBlock(_formulation); _project.AddBuildingBlock(_protocol); _project.AddBuildingBlock(_population); _project.AddObservedData(_observedData); _project.AddBuildingBlock(_simulation); _project.AddClassifiable(_classifiableObservedData); _project.AddClassification(_classification); _project.AddSimulationComparison(_simulationComparison); _project.AddParameterIdentification(_parameterIdentification); _project.AddQualificationPlan(_qualificationPlan); _compoundSnapshot = new Snapshots.Compound(); _individualSnapshot = new Snapshots.Individual(); _eventSnapshot = new Event(); _formulationSnapshot = new Snapshots.Formulation(); _protocolSnapshot = new Snapshots.Protocol(); _populationSnapshot = new Snapshots.Population(); _observedDataSnapshot = new Snapshots.DataRepository(); _parameterIdentificationSnapshot = new ParameterIdentification(); _observedDataClassificationSnapshot = new Snapshots.Classification(); _simulationComparisonSnapshot = new SimulationComparison(); _simulationClassificationSnapshot = new Snapshots.Classification(); _comparisonClassificationSnapshot = new Snapshots.Classification(); _parameterIdentificationClassificationSnapshot = new Snapshots.Classification(); _qualificationPlanClassificationSnapshot = new Snapshots.Classification(); _qualificationPlanSnapshot = new Snapshots.QualificationPlan(); _simulationSnapshot = new Simulation(); A.CallTo(() => _snapshotMapper.MapToSnapshot(_compound)).Returns(_compoundSnapshot); A.CallTo(() => _snapshotMapper.MapToSnapshot(_individual)).Returns(_individualSnapshot); A.CallTo(() => _snapshotMapper.MapToSnapshot(_event)).Returns(_eventSnapshot); A.CallTo(() => _snapshotMapper.MapToSnapshot(_formulation)).Returns(_formulationSnapshot); A.CallTo(() => _snapshotMapper.MapToSnapshot(_protocol)).Returns(_protocolSnapshot); A.CallTo(() => _snapshotMapper.MapToSnapshot(_population)).Returns(_populationSnapshot); A.CallTo(() => _snapshotMapper.MapToSnapshot(_observedData)).Returns(_observedDataSnapshot); A.CallTo(() => _simulationMapper.MapToSnapshot(_simulation, _project)).Returns(_simulationSnapshot); A.CallTo(() => _simulationComparisonMapper.MapToSnapshot(_simulationComparison)).Returns(_simulationComparisonSnapshot); A.CallTo(() => _parameterIdentificationMapper.MapToSnapshot(_parameterIdentification, _project)).Returns(_parameterIdentificationSnapshot); A.CallTo(() => _qualificationPlanMapper.MapToSnapshot(_qualificationPlan)).Returns(_qualificationPlanSnapshot); A.CallTo(() => _classificationSnapshotTask.MapClassificationsToSnapshots <ClassifiableObservedData>(_project)).Returns(new[] { _observedDataClassificationSnapshot }); A.CallTo(() => _classificationSnapshotTask.MapClassificationsToSnapshots <ClassifiableSimulation>(_project)).Returns(new[] { _simulationClassificationSnapshot }); A.CallTo(() => _classificationSnapshotTask.MapClassificationsToSnapshots <ClassifiableComparison>(_project)).Returns(new[] { _comparisonClassificationSnapshot }); A.CallTo(() => _classificationSnapshotTask.MapClassificationsToSnapshots <ClassifiableParameterIdentification>(_project)).Returns(new[] { _parameterIdentificationClassificationSnapshot }); A.CallTo(() => _classificationSnapshotTask.MapClassificationsToSnapshots <ClassifiableQualificationPlan>(_project)).Returns(new[] { _qualificationPlanClassificationSnapshot }); return(_completed); }
private void addParameterIdentificationToProject(ModelProject project, ModelParameterIdentification parameterIdentification) { addClassifiableToProject <ClassifiableParameterIdentification, ModelParameterIdentification>(project, parameterIdentification, project.AddParameterIdentification); }
public ParameterIdentificationContext(OSPSuite.Core.Domain.ParameterIdentifications.ParameterIdentification parameterIdentification, PKSimProject project) { ParameterIdentification = parameterIdentification; Project = project; }
public ParameterIdentificationContext(ModelParameterIdentification parameterIdentification, SnapshotContext snapshotContext) : base(snapshotContext) { ParameterIdentification = parameterIdentification; }