<commit_before>﻿using IdunnSql.Console;
using IdunnSql.Core.Model;
using IdunnSql.Core.Template.StringTemplate;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace IdunnSql.Testing.Acceptance
{
    [TestFixture]
    public class ProgramTest
    {
        [Test]
        public void Main_Generate_Succesful()
        {
            var source = ResourceOnDisk.CreatePhysicalFile("Sample.xml", "IdunnSql.Testing.Acceptance.Resources.Sample.xml");
            var destination = Path.ChangeExtension(source, ".sql");

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

            var result = Program.Main(args.ToArray());
            Assert.That(result, Is.EqualTo(0));
        }

        [Test]
        public void Main_GenerateWithImpersonate_Succesful()
        {
            var source = ResourceOnDisk.CreatePhysicalFile("Sample.xml", "IdunnSql.Testing.Acceptance.Resources.Sample.xml");
            var destination = Path.ChangeExtension(source, ".impersonate.sql");

            var args = new List<string>();
            args.Add("generate");
            args.Add($"--source={source}");
            args.Add($"--destination={destination}");
            args.Add($"--principal=Proxy_ETL");

            var result = Program.Main(args.ToArray());
            Assert.That(result, Is.EqualTo(0));
        }

        [Test]
        public void Main_ExecuteWithCurrentUser_Succesful()
        {
            var source = ResourceOnDisk.CreatePhysicalFile("AdventureWorksDW2012.xml", "IdunnSql.Testing.Acceptance.Resources.AdventureWorksDW2012.xml");

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

            var result = Program.Main(args.ToArray());
            Assert.That(result, Is.EqualTo(0));
        }

        [Test]
        public void Main_ExecuteWithImpersonation_Succesful()
        {
            var source = ResourceOnDisk.CreatePhysicalFile("AdventureWorksDW2012.xml", "IdunnSql.Testing.Acceptance.Resources.AdventureWorksDW2012.xml");

            var args = new List<string>();
            args.Add("execute");<commit_msg>Add category for the new tests to exclude them from appVeyor<commit_after>﻿using IdunnSql.Console;
using IdunnSql.Core.Model;
using IdunnSql.Core.Template.StringTemplate;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace IdunnSql.Testing.Acceptance
{
    [TestFixture]
    public class ProgramTest
    {
        [Test]
        public void Main_Generate_Succesful()
        {
            var source = ResourceOnDisk.CreatePhysicalFile("Sample.xml", "IdunnSql.Testing.Acceptance.Resources.Sample.xml");
            var destination = Path.ChangeExtension(source, ".sql");

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

            var result = Program.Main(args.ToArray());
            Assert.That(result, Is.EqualTo(0));
        }

        [Test]
        public void Main_GenerateWithImpersonate_Succesful()
        {
            var source = ResourceOnDisk.CreatePhysicalFile("Sample.xml", "IdunnSql.Testing.Acceptance.Resources.Sample.xml");
            var destination = Path.ChangeExtension(source, ".impersonate.sql");

            var args = new List<string>();
            args.Add("generate");
            args.Add($"--source={source}");
            args.Add($"--destination={destination}");
            args.Add($"--principal=Proxy_ETL");

            var result = Program.Main(args.ToArray());
            Assert.That(result, Is.EqualTo(0));
        }

        [Test]
        [Category("AdventureWorksDW2012")]
        public void Main_ExecuteWithCurrentUser_Succesful()
        {
            var source = ResourceOnDisk.CreatePhysicalFile("AdventureWorksDW2012.xml", "IdunnSql.Testing.Acceptance.Resources.AdventureWorksDW2012.xml");

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

            var result = Program.Main(args.ToArray());
            Assert.That(result, Is.EqualTo(0));
        }

        [Test]
        [Category("AdventureWorksDW2012")]
        public void Main_ExecuteWithImpersonation_Succesful()
        {
            var source = ResourceOnDisk.CreatePhysicalFile("AdventureWorksDW2012.xml", "IdunnSql.Testing.Acceptance.Resources.AdventureWorksDW2012.xml");

            var args = new List<string>();
            args.Add("execute");
{'fraction_non_alphanumeric': 0.12845162609940683, 'fraction_numerical': 0.009408877070975659, 'mean_word_length': 2.5771762984637894, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2222799', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1327, 'n_words': 229}