<commit_before>﻿namespace Nvelope.Tests.Web
{
    using System;
    using System.Collections.Generic;
    using NUnit.Framework;
    using Nvelope.Web;

    [TestFixture]
    class HtmlExtensionTests
    {
        [Test]
        public void HtmlFormat()
        {
            // list of expected html, format, and a single escaped paramenter
            var Examples = new List<Tuple<string, string, string>>
            {
                Tuple.Create("foo bar", "foo {0}", "bar"),
                Tuple.Create("<p>&lt;&gt;&quot;</p>", "<p>{0}</p>", "<>\""),
                Tuple.Create("This is Mr. O&#39;brian.", "This is {0}.", "Mr. O'brian")
            };

            foreach (var ex in Examples)
            {
                Assert.AreEqual(ex.Item1, ex.Item2.HtmlFormat(ex.Item3).ToHtmlString());
            }
        }
    }
}<commit_msg>Wrote some new tests for desired behavior.<commit_after>﻿namespace Nvelope.Tests.Web
{
    using System;
    using System.Collections.Generic;
    using NUnit.Framework;
    using Nvelope.Web;

    [TestFixture]
    class HtmlExtensionTests
    {
        [Test]
        public void HtmlFormat()
        {
            // list of expected html, format, and a single escaped paramenter
            var Examples = new List<Tuple<string, string, string>>
            {
                Tuple.Create("foo bar", "foo {0}", "bar"),
                Tuple.Create("<p>&lt;&gt;&quot;</p>", "<p>{0}</p>", "<>\""),
                Tuple.Create("This is Mr. O&#39;brian.", "This is {0}.", "Mr. O'brian"),
                Tuple.Create("<h1>&#39;Ali &amp; Ch&#238;&#39; &lt;0&gt;</h1>", "<h1>{0}</h1>", "'Ali & Chî' <0>"),
            };

            foreach (var ex in Examples)
            {
                Assert.AreEqual(ex.Item1, ex.Item2.HtmlFormat(ex.Item3).ToHtmlString());
            }
        }

        [Test]
        public void HtmlFormatFormats()
        {
            Assert.AreEqual("Amount: " + (10m).ToString("c"), "Amount: {0:c}".HtmlFormat(10m).ToHtmlString());
        }

        [Test]
        public void HtmlFormatExceptions()
        {
            Assert.Throws<ArgumentNullException>(() => "foo{0}bar".HtmlFormat(null));
        }
    }
}
{'fraction_non_alphanumeric': 0.1624203821656051, 'fraction_numerical': 0.01637852593266606, 'mean_word_length': 1.8745098039215686, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 24, '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': '1982972', 'n_tokens_mistral': 689, 'n_tokens_neox': 656, 'n_words': 140}