Esempio n. 1
0
        public void Main_GenerateExternalTemplate_Succesful(string extension)
        {
            var source      = ResourceOnDisk.CreatePhysicalFile($"Sample.{extension}", $"Idunn.Testing.Acceptance.Resources.Sample.{extension}");
            var template    = ResourceOnDisk.CreatePhysicalFile("MarkdownTemplate.md", "Idunn.Testing.Acceptance.Resources.MarkdownTemplate.md");
            var destination = Path.ChangeExtension(source, $".{extension}.output.md");

            if (File.Exists(destination))
            {
                File.Delete(destination);
            }

            var args = new List <string>()
            {
                "generate",
                $"--source={source}",
                $"--destination={destination}",
                $"--template={template}"
            };

            var result = Program.Main(args.ToArray());

            Assert.That(result, Is.EqualTo(0));

            var expected = ResourceOnMemory.GetContent("Idunn.Testing.Acceptance.Resources.Sample.expected.md");
            var actual   = File.ReadAllText(destination);

            Assert.That(actual, Is.EqualTo(expected));
        }
Esempio n. 2
0
        public void Main_ExecuteWithImpersonation_Succesful(string extension)
        {
            var source = ResourceOnDisk.CreatePhysicalFile($"AdventureWorksDW2012.{extension}", $"Idunn.Testing.Acceptance.Resources.AdventureWorksDW2012.{extension}");

            var args = new List <string>()
            {
                "execute",
                $"--source={source}"
            };
            var result = Program.Main(args.ToArray());

            Assert.That(result, Is.EqualTo(0));
        }
Esempio n. 3
0
        public void Main_GenerateWithImpersonation_Succesful(string extension)
        {
            var source      = ResourceOnDisk.CreatePhysicalFile($"AdventureWorksDW2012.{extension}", $"Idunn.Testing.Acceptance.Resources.AdventureWorksDW2012.{extension}");
            var destination = Path.ChangeExtension(source, $".{extension}.sql");

            if (File.Exists(destination))
            {
                File.Delete(destination);
            }

            var args = new List <string>()
            {
                "generate",
                $"--source={source}",
                $"--destination={destination}",
            };
            var result = Program.Main(args.ToArray());

            Assert.That(result, Is.EqualTo(0));
        }
Esempio n. 4
0
        public void Main_ExecuteWithOutput_Succesful(string extension)
        {
            var source = ResourceOnDisk.CreatePhysicalFile($"AdventureWorksDW2012.{extension}", $"Idunn.Testing.Acceptance.Resources.AdventureWorksDW2012.{extension}");
            var output = Path.ChangeExtension(source, $"{extension}.output.txt");

            var args = new List <string>()
            {
                "execute",
                $"--source={source}",
                $"--output={output}"
            };

            var result = Program.Main(args.ToArray());

            Assert.That(result, Is.EqualTo(0));

            var expected = ResourceOnMemory.GetContent("Idunn.Testing.Acceptance.Resources.AdventureWorksDW2012.expected.txt");
            var actual   = File.ReadAllText(output);

            Assert.That(actual, Is.EqualTo(expected));
        }