Beispiel #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));
        }
Beispiel #2
0
 protected override async Task Because()
 {
     _result = await sut.MapToModel(_snapshot, new SnapshotContext());
 }
Beispiel #3
0
 protected override async Task Because()
 {
     _result = await sut.MapToModel(_snapshot);
 }