<commit_before>﻿using System;
using System.Linq;
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.DocumentationBuilders.HTML
{
    [TestFixture]
    public class WhenFormattingScenario : BaseFixture
    {
        [Test]
        public void ThenCanRenderTags()
        {
            var configuration = Container.Resolve<Configuration>();

            var scenario = new Scenario
                              {
                                  Name = "A Scenario",
                                  Description = @"This scenario has tags",
                                  Tags = { "tag1", "tag2" }
                              };

            var htmlFeatureFormatter = Container.Resolve<HtmlScenarioFormatter>();
            XElement featureElement = htmlFeatureFormatter.Format(scenario, 1);
            XElement header = featureElement.Elements().FirstOrDefault(element => element.Name.LocalName == "div");

            Check.That(header).IsNotNull();
            Check.That(header).IsNamed("div");
            Check.That(header).IsInNamespace("http://www.w3.org/1999/xhtml");
            Check.That(header).HasAttribute("class", "scenario-heading");
            Assert.AreEqual(3, header.Elements().Count());

            Check.That(header.Elements().ElementAt(0)).IsNamed("h2");<commit_msg>Convert to NFluent<commit_after>﻿using System;
using System.Linq;
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.DocumentationBuilders.HTML
{
    [TestFixture]
    public class WhenFormattingScenario : BaseFixture
    {
        [Test]
        public void ThenCanRenderTags()
        {
            var configuration = Container.Resolve<Configuration>();

            var scenario = new Scenario
                              {
                                  Name = "A Scenario",
                                  Description = @"This scenario has tags",
                                  Tags = { "tag1", "tag2" }
                              };

            var htmlFeatureFormatter = Container.Resolve<HtmlScenarioFormatter>();
            XElement featureElement = htmlFeatureFormatter.Format(scenario, 1);
            XElement header = featureElement.Elements().FirstOrDefault(element => element.Name.LocalName == "div");

            Check.That(header).IsNotNull();
            Check.That(header).IsNamed("div");
            Check.That(header).IsInNamespace("http://www.w3.org/1999/xhtml");
            Check.That(header).HasAttribute("class", "scenario-heading");
            Check.That(header.Elements().Count()).IsEqualTo(3);

            Check.That(header.Elements().ElementAt(0)).IsNamed("h2");
{'fraction_non_alphanumeric': 0.11208053691275167, 'fraction_numerical': 0.00738255033557047, 'mean_word_length': 2.208826695371367, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2373326', 'n_tokens_mistral': 787, 'n_tokens_neox': 759, 'n_words': 134}