<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using FluentAssertions;
using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.Zip;
using Lucid.Web.ProjectCreation;
using NUnit.Framework;

namespace Lucid.System.Tests.ProjectCreation
{
    [TestFixture]
    [Explicit("Very slow system test - this is run explicitly before pushing to production")]
    public class GenerateProjectTests
    {
        [Test]
        public void Execute()
        {
            var cmd = new GenerateProject { Name = "ShinyNewProject1" };

            var zipBytes = cmd.Execute();

            var originalFolder = @"..\..\..";
            var buildFolder = Path.Combine(Path.GetTempPath(), "GpTmp");
            Console.WriteLine("Building project {0} in {1}", cmd.Name, buildFolder);
            Unzip(zipBytes, buildFolder);
            CopyFolder(@"..\..\..\packages", Path.Combine(buildFolder, "packages"));
            var currentBuildEnvironment = File.ReadAllText(Path.Combine(originalFolder, "_items/BuildEnvironment.json"));
            File.WriteAllText(Path.Combine(buildFolder, "_items/BuildEnvironment.json"), currentBuildEnvironment.Replace("Lucid", "ShinyNewProject1"));

            var fxFolder = @"C:\Program Files (x86)\MSBuild\14.0\Bin\";
            var setupCmd = File.ReadAllText(Path.Combine(buildFolder, "CommandPrompt.bat"));<commit_msg>Fixed system test to use new settings.config<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using FluentAssertions;
using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.Zip;
using Lucid.Web.ProjectCreation;
using NUnit.Framework;

namespace Lucid.System.Tests.ProjectCreation
{
    [TestFixture]
    [Explicit("Very slow system test - this is run explicitly before pushing to production")]
    public class GenerateProjectTests
    {
        [Test]
        public void Execute()
        {
            var cmd = new GenerateProject { Name = "ShinyNewProject1" };

            var zipBytes = cmd.Execute();

            var originalFolder = @"..\..\..";
            var buildFolder = Path.Combine(Path.GetTempPath(), "GpTmp");
            Console.WriteLine("Building project {0} in {1}", cmd.Name, buildFolder);
            Unzip(zipBytes, buildFolder);
            CopyFolder(@"..\..\..\packages", Path.Combine(buildFolder, "packages"));
            var currentSettings = File.ReadAllText(Path.Combine(originalFolder, "Lucid.Web/settings.config"));
            File.WriteAllText(Path.Combine(buildFolder, "ShinyNewProject1.Web/settings.config"), currentSettings.Replace("Lucid", "ShinyNewProject1"));

            var fxFolder = @"C:\Program Files (x86)\MSBuild\14.0\Bin\";
            var setupCmd = File.ReadAllText(Path.Combine(buildFolder, "CommandPrompt.bat"));
{'fraction_non_alphanumeric': 0.12457798784604997, 'fraction_numerical': 0.006414584740040513, 'mean_word_length': 3.33187134502924, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3831800', 'n_tokens_mistral': 860, 'n_tokens_neox': 817, 'n_words': 181}