public void TestSeparateFullKeyProviderBothPrefixes()
        {
            var directory    = Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProviderBothPrefixes");
            var outputWriter = new FileWatcherOutputWriter(directory);

            Compiler.Generate(
                "SeparateFullKeyProviderBothPrefixes",
                PrefixPattern,
                new Generator
            {
                OutputWriter      = outputWriter,
                EnableDataBinding = true,
                SeparateClasses   = true,
                NamespacePrefix   = "Generator.Prefix",
                NamespaceProvider = new Dictionary <NamespaceKey, string>
                {
                    { new NamespaceKey("http://tempuri.org/PurchaseOrderSchema.xsd"), "NamedNamespace" },
                }.ToNamespaceProvider(new GeneratorConfiguration {
                    NamespacePrefix = "GeneratorConfiguration.Prefix"
                }.NamespaceProvider.GenerateNamespace),
            });

            SharedTestFunctions.TestSamples(_output, "SeparateFullKeyProviderBothPrefixes", PrefixPattern);
            Assert.Equal(2, outputWriter.Files.Count());
            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
        }
        public void TestEmptyKeyProviderBothPrefixes()
        {
            var directory    = Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProviderBothPrefixes");
            var outputWriter = new FileWatcherOutputWriter(directory);

            Compiler.Generate(
                "EmptyKeyProviderBothPrefixes",
                PrefixPattern,
                new Generator
            {
                OutputWriter      = outputWriter,
                EnableDataBinding = true,
                NamespacePrefix   = "Generator.Prefix",
                NamespaceProvider = new Dictionary <NamespaceKey, string>
                {
                    { new NamespaceKey(String.Empty), "NamedNamespace" },
                }.ToNamespaceProvider(new GeneratorConfiguration {
                    NamespacePrefix = "GeneratorConfiguration.Prefix"
                }.NamespaceProvider.GenerateNamespace),
            });

            SharedTestFunctions.TestSamples(_output, "EmptyKeyProviderBothPrefixes", PrefixPattern);
            Assert.Single(outputWriter.Files);
            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
        }
        public void TestDefaultProviderGeneratorPrefix()
        {
            var directory    = Path.Combine("output", "FileOutputWriterTests", "DefaultProviderGeneratorPrefix");
            var outputWriter = new FileWatcherOutputWriter(directory);

            Compiler.Generate(
                "DefaultProviderGeneratorPrefix",
                PrefixPattern,
                new Generator
            {
                OutputWriter      = outputWriter,
                EnableDataBinding = true,
                NamespacePrefix   = "Generator.Prefix",
            });

            SharedTestFunctions.TestSamples(_output, "DefaultProviderGeneratorPrefix", PrefixPattern);
            Assert.Single(outputWriter.Files);
            Assert.Equal(Path.Combine(directory, "Generator.Prefix.cs"), outputWriter.Files.First());
        }
        public void TestFullKeyProvider()
        {
            var directory    = Path.Combine("output", "FileOutputWriterTests", "FullKeyProvider");
            var outputWriter = new FileWatcherOutputWriter(directory);

            Compiler.Generate(
                "FullKeyProvider",
                PrefixPattern,
                new Generator
            {
                OutputWriter      = outputWriter,
                EnableDataBinding = true,
                NamespaceProvider = new Dictionary <NamespaceKey, string>
                {
                    { new NamespaceKey("http://tempuri.org/PurchaseOrderSchema.xsd"), "NamedNamespace" },
                }.ToNamespaceProvider(),
            });

            SharedTestFunctions.TestSamples(_output, "FullKeyProvider", PrefixPattern);
            Assert.Single(outputWriter.Files);
            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
        }
        public void TestSeparateEmptyKeyProvider()
        {
            var directory    = Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProvider");
            var outputWriter = new FileWatcherOutputWriter(directory);

            Compiler.Generate(
                "SeparateEmptyKeyProvider",
                PrefixPattern,
                new Generator
            {
                OutputWriter      = outputWriter,
                EnableDataBinding = true,
                SeparateClasses   = true,
                NamespaceProvider = new Dictionary <NamespaceKey, string>
                {
                    { new NamespaceKey(String.Empty), "NamedNamespace" },
                }.ToNamespaceProvider(),
            });

            SharedTestFunctions.TestSamples(_output, "SeparateEmptyKeyProvider", PrefixPattern);
            Assert.Equal(2, outputWriter.Files.Count());
            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
        }