Esempio n. 1
0
        protected override Task Context()
        {
            var molWeightDimension = A.Fake <IDimension>();

            _extendedPropertyMapper = A.Fake <ExtendedPropertyMapper>();
            var dimensionRepository = A.Fake <IDimensionRepository>();

            A.CallTo(() => dimensionRepository.DimensionByName(Constants.Dimension.MOLECULAR_WEIGHT)).Returns(molWeightDimension);
            sut = new DataInfoMapper(_extendedPropertyMapper, dimensionRepository);

            _extendedPropertySnapshot = new ExtendedProperty();

            _dataInfo = new DataInfo(ColumnOrigins.Observation, AuxiliaryType.GeometricStdDev, "unitName", "category", 2.3)
            {
                LLOQ = 0.4f
            };
            _extendedProperty = new ExtendedProperty <string> {
                Name = "Hello"
            };
            _dataInfo.ExtendedProperties.Add(_extendedProperty);
            A.CallTo(() => molWeightDimension.BaseUnitValueToUnitValue(molWeightDimension.DefaultUnit, _dataInfo.MolWeight.Value)).Returns(5.0);
            A.CallTo(() => molWeightDimension.UnitValueToBaseUnitValue(molWeightDimension.DefaultUnit, 5.0)).Returns(_dataInfo.MolWeight.Value);

            A.CallTo(() => _extendedPropertyMapper.MapToSnapshot(_extendedProperty)).Returns(_extendedPropertySnapshot);
            A.CallTo(() => _extendedPropertyMapper.MapToModel(_extendedPropertySnapshot, A <SnapshotContext> ._)).Returns(_extendedProperty);

            return(Task.FromResult(true));
        }
Esempio n. 2
0
        protected override Task Context()
        {
            _dataColumnMapper       = A.Fake <DataColumnMapper>();
            _extendedPropertyMapper = A.Fake <ExtendedPropertyMapper>();
            sut = new DataRepositoryMapper(_extendedPropertyMapper, _dataColumnMapper);

            _dataRepository = DomainHelperForSpecs.ObservedData();
            _dataColumn     = _dataRepository.ObservationColumns().First();
            _relatedColumn  = new DataColumn("related", DomainHelperForSpecs.NoDimension(), _dataRepository.BaseGrid)
            {
                Values   = new[] { 0f, 0f, 0f },
                DataInfo = { Origin = ColumnOrigins.ObservationAuxiliary }
            };
            _dataColumn.AddRelatedColumn(_relatedColumn);
            _dataRepository.Add(_relatedColumn);
            _dataRepository.Description = "description";
            _dataRepository.Name        = "thename";
            _extendedProperty           = new ExtendedProperty <string> {
                Name = "Name"
            };
            _dataRepository.ExtendedProperties.Add(_extendedProperty);
            _dataColumnSnapshot       = new Snapshots.DataColumn();
            _extendedPropertySnapshot = new Snapshots.ExtendedProperty();
            _baseGridSnapshot         = new Snapshots.DataColumn();
            A.CallTo(() => _dataColumnMapper.MapToSnapshot(_dataColumn)).Returns(_dataColumnSnapshot);
            A.CallTo(() => _extendedPropertyMapper.MapToSnapshot(_extendedProperty)).Returns(_extendedPropertySnapshot);
            A.CallTo(() => _extendedPropertyMapper.MapToModel(_extendedPropertySnapshot, A <SnapshotContext> ._)).Returns(_extendedProperty);
            A.CallTo(() => _dataColumnMapper.MapToSnapshot(_dataRepository.BaseGrid)).Returns(_baseGridSnapshot);

            return(Task.FromResult(true));
        }
Esempio n. 3
0
        protected override Task Context()
        {
            _extendedPropertyMapper = A.Fake <ExtendedPropertyMapper>();
            _property1 = new ExtendedProperty <string> {
                Name = "Hello", Value = "Val", FullName = "This is full", Description = "Description"
            };
            _algoProperties = new OptimizationAlgorithmProperties("PROP")
            {
                _property1
            };

            sut = new ParameterIdentificationAlgorithmMapper(_extendedPropertyMapper);

            _snapshotExtendedProperty = new ExtendedProperty
            {
                Description = "HELLO",
                FullName    = "This is the full name"
            };

            A.CallTo(() => _extendedPropertyMapper.MapToSnapshot(_property1)).Returns(_snapshotExtendedProperty);

            return(_completed);
        }