Ejemplo n.º 1
0
        protected override Task Context()
        {
            _quantityInfoMapper  = A.Fake <QuantityInfoMapper>();
            _dataInfoMapper      = A.Fake <DataInfoMapper>();
            _dimensionRepository = A.Fake <IDimensionRepository>();
            sut = new DataColumnMapper(_dataInfoMapper, _quantityInfoMapper, _dimensionRepository);

            var observedData = DomainHelperForSpecs.ObservedData();

            _dataColumn    = observedData.ObservationColumns().First();
            _baseGrid      = observedData.BaseGrid;
            _relatedColumn = new DataColumn("related", DomainHelperForSpecs.NoDimension(), observedData.BaseGrid)
            {
                Values   = new[] { 0f, 0f, 0f },
                DataInfo = { Origin = ColumnOrigins.ObservationAuxiliary }
            };
            _dataColumn.AddRelatedColumn(_relatedColumn);

            _quantityInfoSnapshot = new Snapshots.QuantityInfo();
            _dataInfoSnapshot     = new Snapshots.DataInfo();
            A.CallTo(() => _quantityInfoMapper.MapToSnapshot(_dataColumn.QuantityInfo)).Returns(_quantityInfoSnapshot);
            A.CallTo(() => _dataInfoMapper.MapToSnapshot(_dataColumn.DataInfo)).Returns(_dataInfoSnapshot);
            A.CallTo(() => _dimensionRepository.DimensionByName(_dataColumn.Dimension.Name)).Returns(_dataColumn.Dimension);
            A.CallTo(() => _dimensionRepository.DimensionByName(_baseGrid.Dimension.Name)).Returns(_baseGrid.Dimension);

            return(Task.FromResult(true));
        }
Ejemplo 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));
        }
        protected override void Context()
        {
            _observedDataCollection = new ObservedDataCollection();
            _displayPathMapper      = A.Fake <IQuantityPathToQuantityDisplayPathMapper>();
            _dimensionRepository    = A.Fake <IDimensionRepository>();
            sut              = new DataRepositoryToObservedCurveDataMapper(_displayPathMapper, _dimensionRepository);
            _observedData    = new DataRepository();
            _baseGrid        = new BaseGrid("Time", DomainHelperForSpecs.TimeDimensionForSpecs());
            _baseGrid.Values = new[] { 1.0f, 2.0f, 3.0f };

            _data                 = new DataColumn("Col", DomainHelperForSpecs.ConcentrationDimensionForSpecs(), _baseGrid);
            _data.Values          = new[] { 10f, 20f, 30f };
            _data.DataInfo.Origin = ColumnOrigins.Observation;

            _observedData.Add(_data);

            _errorArithmetic        = new DataColumn("ErrorArithmetic", _data.Dimension, _baseGrid);
            _errorArithmetic.Values = new[] { 1.0f, 2.2f, 3.3f };
            _errorArithmetic.DataInfo.AuxiliaryType = AuxiliaryType.ArithmeticStdDev;

            _errorGeometric        = new DataColumn("ErrorGeometric", DomainHelperForSpecs.NoDimension(), _baseGrid);
            _errorGeometric.Values = new[] { 1.0f, 1.2f, 1.3f };
            _errorGeometric.DataInfo.AuxiliaryType = AuxiliaryType.GeometricStdDev;

            _observedDataCollection.AddObservedData(_observedData);

            _curveOptions           = _observedDataCollection.ObservedDataCurveOptionsFor(_data).CurveOptions;
            _curveOptions.Color     = Color.Aqua;
            _curveOptions.LineStyle = LineStyles.Dot;
            _curveOptions.Symbol    = Symbols.Diamond;
        }
Ejemplo n.º 4
0
 protected override void Context()
 {
     base.Context();
     _table            = new TableFormula();
     _table.Dimension  = DomainHelperForSpecs.LengthDimensionForSpecs();
     _table.XDimension = DomainHelperForSpecs.NoDimension();
     _table.AddPoint(1, 10);
     _table.AddPoint(2, 20);
 }