public TSQLTestBase(string schema)
        {
            string connectionString = Resources.TestDbConnectionString;

            IServiceCollection services = new ServiceCollection();

            services.AddVtlProcessing((configure) =>
            {
                configure.DataModels.DefaultNamespace = "ns";
                configure.DataModels.AddSqlServerModel(connectionString);
                configure.EnvironmentMapper.Mapping = new Dictionary <string, string>()
                {
                    { "ns", $"[{schema}]." }
                };
            });

            services.AddTsqlTarget();

            this.errCollectorProvider = new ErrorCollectorProvider();
            services.AddLogging((configure) =>
            {
                configure.AddProvider(this.errCollectorProvider);
            });

            this.provider = services.BuildServiceProvider();

            this.frontEnd  = provider.GetFrontEnd();
            this.middleEnd = provider.GetMiddleEnd();
        }
Beispiel #2
0
 public TranslationService(ILogger <TranslationService> logger,
                           ITreeGenerator treeGenerator,
                           ISchemaModifiersApplier schemaModifiersApplier,
                           IEnumerable <ILoggerProvider> loggerProviders,
                           IEnumerable <ITargetRenderer> targetRenderers,
                           IDataModelAggregator dataModelAggregator)
 {
     this._logger                 = logger;
     this._treeGenerator          = treeGenerator;
     this._schemaModifiersApplier = schemaModifiersApplier;
     this._errorCollectorProvider = (ErrorCollectorProvider)loggerProviders.SingleOrDefault(l => l.GetType() == typeof(ErrorCollectorProvider));
     this._dataModelAggregator    = dataModelAggregator;
     this._targetRenderers        = targetRenderers;
 }
 public TranslationService(ILogger <TranslationService> logger,
                           ITreeGenerator treeGenerator,
                           ISchemaModifiersApplier schemaModifiersApplier,
                           IEnumerable <ILoggerProvider> loggerProviders,
                           IEnumerable <ITargetRenderer> targetRenderers,
                           IDataModelAggregator dataModelAggregator,
                           IEnvironmentMapper mapper)
 {
     this.logger                 = logger;
     this.treeGenerator          = treeGenerator;
     this.schemaModifiersApplier = schemaModifiersApplier;
     this.dataModelAggregator    = dataModelAggregator;
     this.mapper                 = mapper;
     this.targetRenderers        = targetRenderers;
 }