예제 #1
0
 public SimulationFactory(IIdGenerator idGenerator, ICreationMetaDataFactory creationMetaDataFactory, ISimulationParameterOriginIdUpdater simulationParameterOriginIdUpdater, IDiagramManagerFactory diagramManagerFactory)
 {
     _idGenerator                        = idGenerator;
     _creationMetaDataFactory            = creationMetaDataFactory;
     _simulationParameterOriginIdUpdater = simulationParameterOriginIdUpdater;
     _diagramManagerFactory              = diagramManagerFactory;
 }
예제 #2
0
 protected override void Context()
 {
     _idGenerator           = A.Fake <IIdGenerator>();
     _metaDataFactory       = A.Fake <ICreationMetaDataFactory>();
     _parameterIdUpdater    = A.Fake <ISimulationParameterOriginIdUpdater>();
     _diagramManagerFactory = A.Fake <IDiagramManagerFactory>();
     sut = new SimulationFactory(_idGenerator, _metaDataFactory, _parameterIdUpdater, _diagramManagerFactory);
 }
예제 #3
0
 protected override void Context()
 {
     _noDimension             = A.Fake <IDimension>();
     _dimensionFactory        = A.Fake <IDimensionFactory>();
     _creationMetaDataFactory = A.Fake <ICreationMetaDataFactory>();
     A.CallTo(() => _dimensionFactory.NoDimension).Returns(_noDimension);
     sut = new ObjectBaseFactory(IoC.Container, _dimensionFactory, new IdGenerator(), _creationMetaDataFactory);
 }
 public ObjectBaseFactory(Utility.Container.IContainer container, IDimensionFactory dimensionFactory,
                          IIdGenerator idGenerator, ICreationMetaDataFactory creationMetaDataFactory)
 {
     _container               = container;
     _dimensionFactory        = dimensionFactory;
     _idGenerator             = idGenerator;
     _creationMetaDataFactory = creationMetaDataFactory;
 }
예제 #5
0
 public PKSimObjectBaseFactory(
     IoC container,
     IDimensionRepository dimensionRepository,
     IIdGenerator idGenerator,
     ICreationMetaDataFactory creationMetaDataFactory)
     : base(container, dimensionRepository.DimensionFactory, idGenerator, creationMetaDataFactory)
 {
 }
        protected override void Context()
        {
            _idGenerator             = A.Fake <IIdGenerator>();
            _parameter               = new PKSimParameter();
            _ioC                     = A.Fake <OSPSuite.Utility.Container.IContainer>();
            _dimensionRepository     = A.Fake <IDimensionRepository>();
            _creationMetaDataFactory = A.Fake <ICreationMetaDataFactory>();
            var dimensionFactory = A.Fake <IDimensionFactory>();

            A.CallTo(() => dimensionFactory.NoDimension).Returns(Constants.Dimension.NO_DIMENSION);
            A.CallTo(() => _dimensionRepository.DimensionFactory).Returns(dimensionFactory);
            A.CallTo(() => _ioC.Resolve <IParameter>()).Returns(_parameter);
            sut = new PKSimObjectBaseFactory(_ioC, _dimensionRepository, _idGenerator, _creationMetaDataFactory);
        }
예제 #7
0
 public ProjectMapper(
     SimulationMapper simulationMapper,
     SimulationComparisonMapper simulationComparisonMapper,
     ParameterIdentificationMapper parameterIdentificationMapper,
     QualificationPlanMapper qualificationPlanMapper,
     IExecutionContext executionContext,
     IClassificationSnapshotTask classificationSnapshotTask,
     ILazyLoadTask lazyLoadTask,
     ICreationMetaDataFactory creationMetaDataFactory,
     ILogger logger)
 {
     _simulationMapper              = simulationMapper;
     _simulationComparisonMapper    = simulationComparisonMapper;
     _parameterIdentificationMapper = parameterIdentificationMapper;
     _qualificationPlanMapper       = qualificationPlanMapper;
     _classificationSnapshotTask    = classificationSnapshotTask;
     _lazyLoadTask            = lazyLoadTask;
     _creationMetaDataFactory = creationMetaDataFactory;
     _logger = logger;
     //required to load the snapshot mapper via execution context to avoid circular references
     _snapshotMapper = new Lazy <ISnapshotMapper>(executionContext.Resolve <ISnapshotMapper>);
 }
예제 #8
0
 public Converter721To730(
     ICompoundFactory compoundFactory,
     ICloner cloner,
     ICreationMetaDataFactory creationMetaDataFactory,
     IContainerTask containerTask,
     IFormulationRepository formulationRepository,
     IEventGroupRepository eventGroupRepository,
     Converter710To730 coreConverter,
     ICompoundProcessRepository compoundProcessRepository,
     ISchemaItemRepository schemaItemRepository
     )
 {
     _compoundFactory           = compoundFactory;
     _cloner                    = cloner;
     _creationMetaDataFactory   = creationMetaDataFactory;
     _containerTask             = containerTask;
     _formulationRepository     = formulationRepository;
     _eventGroupRepository      = eventGroupRepository;
     _coreConverter             = coreConverter;
     _compoundProcessRepository = compoundProcessRepository;
     _schemaItemRepository      = schemaItemRepository;
 }
예제 #9
0
        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);
        }