<commit_before>﻿using System;
using System.Xml.Linq;
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;

namespace PicklesDoc.Pickles.Test
{
    [TestFixture]
    public class ParserTests : BaseFixture
    {
        [Test, TestCaseSource(typeof (ParserFileFactory), "Files")]
        [Ignore("The expected results files need some modification based on the latest changes to the formatters")]
        public void CanParseFeatureFilesSuccessfully(string featureText, string xhtmlText)
        {
            var parser = Container.Resolve<FeatureParser>();
            var htmlDocumentFormatter = Container.Resolve<HtmlFeatureFormatter>();

            string actual;
            using (var reader = new System.IO.StringReader(featureText))
            {
                Feature feature = parser.Parse(reader);
                XElement document = htmlDocumentFormatter.Format(feature);
                actual = document.ToString(SaveOptions.DisableFormatting);
            }

            string expected = XDocument.Parse(xhtmlText).ToString(SaveOptions.DisableFormatting);

            StringAssert.AreEqualIgnoringCase(expected, actual);
        }
    }
}<commit_msg>Convert to NFluent<commit_after>﻿using System;
using System.Xml.Linq;
using NFluent;
using NUnit.Framework;
using Autofac;
using PicklesDoc.Pickles.DocumentationBuilders.HTML;
using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.Parser;

namespace PicklesDoc.Pickles.Test
{
    [TestFixture]
    public class ParserTests : BaseFixture
    {
        [Test, TestCaseSource(typeof (ParserFileFactory), "Files")]
        [Ignore("The expected results files need some modification based on the latest changes to the formatters")]
        public void CanParseFeatureFilesSuccessfully(string featureText, string xhtmlText)
        {
            var parser = Container.Resolve<FeatureParser>();
            var htmlDocumentFormatter = Container.Resolve<HtmlFeatureFormatter>();

            string actual;
            using (var reader = new System.IO.StringReader(featureText))
            {
                Feature feature = parser.Parse(reader);
                XElement document = htmlDocumentFormatter.Format(feature);
                actual = document.ToString(SaveOptions.DisableFormatting);
            }

            string expected = XDocument.Parse(xhtmlText).ToString(SaveOptions.DisableFormatting);

            Check.That(actual).IsEqualIgnoringCase(expected);
        }
    }
}
{'fraction_non_alphanumeric': 0.08284714119019837, 'fraction_numerical': 0.0, 'mean_word_length': 3.0503937007874016, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1200053', 'n_tokens_mistral': 654, 'n_tokens_neox': 636, 'n_words': 147}