Example #1
0
        public void Constructs_correct_canonical_paths(
            string rootNamespace, string projectPath, string outputPath, string expectedNamepace,
            string canonicalizedFullOutputPath, string canonicalizedRelativeOutputPath)
        {
            var outputNamespaceAndPaths = ReverseEngineeringGenerator.ConstructNamespaceAndCanonicalizedPaths(
                rootNamespace, projectPath, outputPath);

            Assert.Equal(expectedNamepace, outputNamespaceAndPaths.Namespace);
            Assert.Equal(canonicalizedFullOutputPath, outputNamespaceAndPaths.CanonicalizedFullOutputPath);
            Assert.Equal(canonicalizedRelativeOutputPath, outputNamespaceAndPaths.CanonicalizedRelativeOutputPath);
        }
Example #2
0
        protected E2ETestBase(ITestOutputHelper output)
        {
            _output = output;

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

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

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