Ejemplo n.º 1
0
        public E2ETestBase(ITestOutputHelper output)
        {
            _output = output;

            var serviceCollection = new ServiceCollection();

            GetFactory().AddMetadataProviderServices(serviceCollection);
            var serviceProvider = serviceCollection
                                  .AddScoped(typeof(ILogger), sp => _logger            = new InMemoryCommandLogger("E2ETest"))
                                  .AddScoped(typeof(IFileService), sp => InMemoryFiles = new InMemoryFileService())
                                  .BuildServiceProvider();

            Generator             = serviceProvider.GetRequiredService <ReverseEngineeringGenerator>();
            MetadataModelProvider = serviceProvider.GetRequiredService <IDatabaseMetadataModelProvider>();

            // set current cultures to English because expected results for error messages
            // (both those output to the Logger and those put in comments in the .cs files)
            // are in English
#if DNXCORE50
            CultureInfo.CurrentCulture   = new CultureInfo("en-US");
            CultureInfo.CurrentUICulture = new CultureInfo("en-US");
#else
            Thread.CurrentThread.CurrentCulture   = new CultureInfo("en-US");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
#endif
        }
Ejemplo n.º 2
0
        public E2ETestBase(ITestOutputHelper output)
        {
            _output = output;

            var serviceCollection = new ServiceCollection()
                                    .AddLogging();

            GetFactory().AddMetadataProviderServices(serviceCollection);
            serviceCollection.AddSingleton(typeof(IFileService), sp => InMemoryFiles = new InMemoryFileService());

            var serviceProvider = serviceCollection.BuildServiceProvider();

            _logger = new InMemoryCommandLogger("E2ETest", _output);
            serviceProvider.GetService <ILoggerFactory>().AddProvider(new TestLoggerProvider(_logger));

            Generator             = serviceProvider.GetRequiredService <ReverseEngineeringGenerator>();
            MetadataModelProvider = serviceProvider.GetRequiredService <IDatabaseMetadataModelProvider>();
        }
Ejemplo n.º 3
0
        public E2ETestBase(ITestOutputHelper output)
        {
            _output = output;

            var serviceCollection = new ServiceCollection()
                .AddLogging();
            ConfigureDesignTimeServices(serviceCollection);
            AddScaffolding(serviceCollection);
            serviceCollection.AddSingleton(typeof(IFileService), sp => InMemoryFiles = new InMemoryFileService());

            var serviceProvider = serviceCollection.BuildServiceProvider();

            _logger = new InMemoryCommandLogger("E2ETest", _output);
            serviceProvider.GetService<ILoggerFactory>().AddProvider(new TestLoggerProvider(_logger));

            Generator = serviceProvider.GetRequiredService<ReverseEngineeringGenerator>();
            ScaffoldingModelFactory = serviceProvider.GetRequiredService<IScaffoldingModelFactory>();
        }
Ejemplo n.º 4
0
        public E2ETestBase(ITestOutputHelper output)
        {
            _output = output;

            var serviceCollection = new ServiceCollection()
                                    .AddLogging();

            ConfigureDesignTimeServices(serviceCollection);
            AddScaffolding(serviceCollection);
            serviceCollection.AddSingleton(typeof(IFileService), sp => InMemoryFiles = new InMemoryFileService());

            var serviceProvider = serviceCollection.BuildServiceProvider();

            _logger = new InMemoryCommandLogger("E2ETest", _output);
            serviceProvider.GetService <ILoggerFactory>().AddProvider(new TestLoggerProvider(_logger));

            Generator = serviceProvider.GetRequiredService <ReverseEngineeringGenerator>();
            ScaffoldingModelFactory = serviceProvider.GetRequiredService <IScaffoldingModelFactory>();
        }