<commit_before>﻿#region licence
// ======================================================================================
// Mvc5UsingBower - An example+library to allow an MVC project to use Bower and Grunt
// Filename: Test20CheckBundlesGood.cs
// Date Created: 2016/02/17
// 
// Under the MIT License (MIT)
// 
// Written by <NAME> : GitHub JonPSmith, www.thereformedprogrammer.net
// ======================================================================================
#endregion

using System.Linq;
using B4BCore;
using NUnit.Framework;
using Tests.Helpers;
using WebApplication.Mvc5;

namespace Tests.UnitTests
{
    public class Test20CheckBundlesGood
    {
        [Test]
        public void TestCheckSingleBundleCssOk()
        {
            //SETUP
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("NoConfig\\"));

            //ATTEMPT
            var errors = checker.CheckSingleBundleIsValid("mainCss");

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckSingleBundleJsOk()
        {
            //SETUP
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("NoConfig\\"));

            //ATTEMPT
            var errors = checker.CheckSingleBundleIsValid("appLibsJs");

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckSingleBundleJsViaTypeOk()
        {
            //SETUP
            var checker = new CheckBundles(typeof(Test20CheckBundlesGood), B4BSetupHelper.GetDirRelToTestDirectory("AbsBowerBundles\\"));

            //ATTEMPT
            var errors = checker.CheckSingleBundleIsValid("appLibsJs");

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckAllBundlesAreUpToDateOk()
        {
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("MinCssAndJs\\"));

            //ATTEMPT
            var errors = checker.CheckAllBundlesAreValid();

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckAllBundlesAreUpToDateInMvcAppOk()
        {
            //SETUP
            var checker = new CheckBundles(typeof(BowerBundlerHelper));

            //ATTEMPT
            var errors = checker.CheckAllBundlesAreValid();

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckBundleFileIsNotNewerThanMinifiedFilesOk()
        {
            //SETUP
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("MinCssAndJs\\"));

            //ATTEMPT
            var error = checker.CheckBundleFileIsNotNewerThanMinifiedFiles();

            //VERIFY
            error.ShouldEqual(null, error);
        }

        [Test]
        public void TestCheckBundleFileIsNotNewerThanMinifiedFilesMvcAppOk()
        {
            //SETUP
            var checker = new CheckBundles(typeof(BowerBundlerHelper));

            //ATTEMPT
            var error = checker.CheckBundleFileIsNotNewerThanMinifiedFiles();

            //VERIFY
            error.ShouldEqual(null, error);
        }

        //------------------------------------------------------------
        //Check with cdns

        [Test]
        public void TestCheckSingleBundleIsUpToDateWithCdnOk()
        {
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("WithCdn\\"));

            //ATTEMPT
            var errors = checker.CheckSingleBundleIsValid("standardLibsCdnJs");

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckBundleFileIsNotNewerThanMinifiedFilesWithCdnOk()
        {
            //SETUP
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("WithCdn\\"));

            //ATTEMPT
            var error = checker.CheckBundleFileIsNotNewerThanMinifiedFiles();

            //VERIFY
            error.ShouldEqual(null, error);
        }
    }
}<commit_msg>Removed test that was done better Test22CheckBundlesBadContent<commit_after>﻿#region licence
// ======================================================================================
// Mvc5UsingBower - An example+library to allow an MVC project to use Bower and Grunt
// Filename: Test20CheckBundlesGood.cs
// Date Created: 2016/02/17
// 
// Under the MIT License (MIT)
// 
// Written by <NAME> : GitHub JonPSmith, www.thereformedprogrammer.net
// ======================================================================================
#endregion

using System.Linq;
using B4BCore;
using NUnit.Framework;
using Tests.Helpers;
using WebApplication.Mvc5;

namespace Tests.UnitTests
{
    public class Test20CheckBundlesGood
    {
        [Test]
        public void TestCheckSingleBundleCssOk()
        {
            //SETUP
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("NoConfig\\"));

            //ATTEMPT
            var errors = checker.CheckSingleBundleIsValid("mainCss");

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckSingleBundleJsOk()
        {
            //SETUP
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("NoConfig\\"));

            //ATTEMPT
            var errors = checker.CheckSingleBundleIsValid("appLibsJs");

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckSingleBundleJsViaTypeOk()
        {
            //SETUP
            var checker = new CheckBundles(typeof(Test20CheckBundlesGood), B4BSetupHelper.GetDirRelToTestDirectory("AbsBowerBundles\\"));

            //ATTEMPT
            var errors = checker.CheckSingleBundleIsValid("appLibsJs");

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckAllBundlesAreUpToDateOk()
        {
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("MinCssAndJs\\"));

            //ATTEMPT
            var errors = checker.CheckAllBundlesAreValid();

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckAllBundlesAreUpToDateInMvcAppOk()
        {
            //SETUP
            var checker = new CheckBundles(typeof(BowerBundlerHelper));

            //ATTEMPT
            var errors = checker.CheckAllBundlesAreValid();

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }

        [Test]
        public void TestCheckBundleFileIsNotNewerThanMinifiedFilesOk()
        {
            //SETUP
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("MinCssAndJs\\"));

            //ATTEMPT
            var error = checker.CheckBundleFileIsNotNewerThanMinifiedFiles();

            //VERIFY
            error.ShouldEqual(null, error);
        }

        [Test]
        public void TestCheckBundleFileIsNotNewerThanMinifiedFilesMvcAppOk()
        {
            //SETUP
            var checker = new CheckBundles(typeof(BowerBundlerHelper));

            //ATTEMPT
            var error = checker.CheckBundleFileIsNotNewerThanMinifiedFiles();

            //VERIFY
            error.ShouldEqual(null, error);
        }

        //------------------------------------------------------------
        //Check with cdns

        [Test]
        public void TestCheckSingleBundleIsUpToDateWithCdnOk()
        {
            var checker = new CheckBundles(TestFileHelpers.GetTestDataFileDirectory(), B4BSetupHelper.GetDirRelToTestDirectory("WithCdn\\"));

            //ATTEMPT
            var errors = checker.CheckSingleBundleIsValid("standardLibsCdnJs");

            //VERIFY
            errors.Any().ShouldEqual(false, string.Join("\n", errors));
        }
    }
}
{'fraction_non_alphanumeric': 0.14839816933638444, 'fraction_numerical': 0.005606407322654462, 'mean_word_length': 2.193642674461089, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6802949', 'n_tokens_mistral': 2412, 'n_tokens_neox': 2325, 'n_words': 399}