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); }
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>(); }