Beispiel #1
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _fakedTimeDimension          = A.Fake <IDimension>();
            _fakedConcentrationDimension = A.Fake <IDimension>();
            _fakedErrorDimension         = A.Fake <IDimension>();
            _fakedDimensionFactory       = A.Fake <IDimensionFactory>();
            _basicFormat   = A.Fake <DataSheet>();
            _container     = A.Fake <IContainer>();
            _dialogCreator = A.Fake <IDialogCreator>();
            var dataFormat = A.Fake <IDataFormat>();

            _columnInfos = new ColumnInfoCache
            {
                new ColumnInfo()
                {
                    DisplayName = "Time"
                },
                new ColumnInfo()
                {
                    DisplayName = "Concentration"
                },
                new ColumnInfo()
                {
                    DisplayName = "Error"
                }
            };

            _columnInfos["Time"].SupportedDimensions.Add(_fakedTimeDimension);
            _columnInfos["Concentration"].SupportedDimensions.Add(_fakedConcentrationDimension);
            _columnInfos["Error"].SupportedDimensions.Add(_fakedErrorDimension);

            A.CallTo(() => dataFormat.SetParameters(_basicFormat, _columnInfos, null)).Returns(1);
            A.CallTo(() => _container.ResolveAll <IDataFormat>()).Returns(new List <IDataFormat>()
            {
                dataFormat
            });
            _parser = A.Fake <IDataSourceFileParser>();
            _dataRepositoryMapper = A.Fake <IDataSetToDataRepositoryMapper>();
            A.CallTo(() => _container.Resolve <IDataSourceFileParser>()).Returns(_parser);
            A.CallTo(() => _fakedTimeDimension.HasUnit("min")).Returns(true);
            A.CallTo(() => _fakedConcentrationDimension.HasUnit("pmol/l")).Returns(true);
            A.CallTo(() => _fakedErrorDimension.HasUnit("pmol/l")).Returns(true);
            sut = new OSPSuite.Infrastructure.Import.Services.Importer(_container, _parser, _dataRepositoryMapper, _fakedDimensionFactory);
        }
Beispiel #2
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _fakedTimeDimension          = A.Fake <IDimension>();
            _fakedConcentrationDimension = A.Fake <IDimension>();
            _fakedErrorDimension         = A.Fake <IDimension>();
            _container             = A.Fake <IContainer>();
            _dialogCreator         = A.Fake <IDialogCreator>();
            _fakedDimensionFactory = A.Fake <IDimensionFactory>();
            var dataFormat = A.Fake <IDataFormat>();

            _columnInfos = new ColumnInfoCache()
            {
                new ColumnInfo()
                {
                    DisplayName = "Time"
                },
                new ColumnInfo()
                {
                    DisplayName = "Concentration"
                },
                new ColumnInfo()
                {
                    DisplayName = "Error"
                }
            };
            _metaDataCategories = new List <MetaDataCategory>()
            {
                new MetaDataCategory()
                {
                    Name = "Organ"
                },
                new MetaDataCategory()
                {
                    Name = "Compartment"
                },
                new MetaDataCategory()
                {
                    Name = "Species"
                },
                new MetaDataCategory()
                {
                    Name = "Dose"
                },
                new MetaDataCategory()
                {
                    Name = "Molecule"
                },
                new MetaDataCategory()
                {
                    Name = "Route"
                }
            };

            _columnInfos["Time"].SupportedDimensions.Add(_fakedTimeDimension);
            _columnInfos["Concentration"].SupportedDimensions.Add(_fakedConcentrationDimension);
            _columnInfos["Error"].SupportedDimensions.Add(_fakedErrorDimension);

            A.CallTo(() => _fakedTimeDimension.HasUnit("min")).Returns(true);
            A.CallTo(() => _fakedConcentrationDimension.HasUnit("pmol/l")).Returns(true);
            A.CallTo(() => _fakedErrorDimension.HasUnit("pmol/l")).Returns(true);
            A.CallTo(() => _container.ResolveAll <IDataFormat>()).Returns(new List <IDataFormat>()
            {
                new DataFormatHeadersWithUnits(), new DataFormatNonmem(), new MixColumnsDataFormat()
            });
            _parser = A.Fake <IDataSourceFileParser>();
            _dataRepositoryMapper = A.Fake <IDataSetToDataRepositoryMapper>();
            A.CallTo(() => _container.Resolve <IDataSourceFileParser>()).Returns(_parser);
            sut = new OSPSuite.Infrastructure.Import.Services.Importer(_container, _parser, _dataRepositoryMapper, _fakedDimensionFactory);
        }