<commit_before>using System;
using System.Linq;
using System.Windows.Media;
using FluentAssertions;
using NEdifis.Attributes;
using NUnit.Framework;

namespace FontAwesome.Sharp.Tests.WPF
{
    [TestFixtureFor(typeof(IconHelper))]
    // ReSharper disable once InconsistentNaming
    internal class IconHelper_Should
    {
        [Test]
        public void Convert_icon_enums_to_characters()
        {
            foreach (var icon in Enum.GetValues(typeof(IconChar)).Cast<IconChar>())
            {
                var expected = char.ConvertFromUtf32((int)icon).Single();
                icon.ToChar().Should().Be(expected);
            }
        }

        [Test]
        public void Lookup_fonts_for_glyphs()
        {
            var limit = -1;
            var icons = Enum.GetValues(typeof(IconChar)).Cast<IconChar>().Skip(1); // 1=None
            if (limit > 0) icons = icons.Take(limit);
            foreach (var icon in icons)
            {
                var fontFamily = IconHelper.FontFor(icon);
                fontFamily.Should().NotBeNull($"should lookup font for '{icon}'");
                fontFamily.Source.Should().Contain("FontAwesome.Sharp");
            }
        }

        [Test]
        public void Generate_imageSources_for_icon_chars()
        {
            var limit = -1;
            var icons = Enum.GetValues(typeof(IconChar)).Cast<IconChar>().Skip(1); // 1=None
            if (limit > 0) icons = icons.Take(limit);
            foreach (var icon in icons)
            {
                const int size = 16;
                var imageSource = icon.ToImageSource(Brushes.Black, size);
                imageSource.Should().NotBeNull($"an image should be generated for '{icon}'");
                imageSource.Should().BeOfType<DrawingImage>();
                Math.Round(imageSource.Width).Should().BeLessOrEqualTo(size);
                Math.Round(imageSource.Height).Should().BeLessOrEqualTo(size);
            }
        }

    }
}<commit_msg>Numeric robustness<commit_after>using System;
using System.Linq;
using System.Windows.Media;
using FluentAssertions;
using NEdifis.Attributes;
using NUnit.Framework;

namespace FontAwesome.Sharp.Tests.WPF
{
    [TestFixtureFor(typeof(IconHelper))]
    // ReSharper disable once InconsistentNaming
    internal class IconHelper_Should
    {
        [Test]
        public void Convert_icon_enums_to_characters()
        {
            foreach (var icon in Enum.GetValues(typeof(IconChar)).Cast<IconChar>())
            {
                var expected = char.ConvertFromUtf32((int)icon).Single();
                icon.ToChar().Should().Be(expected);
            }
        }

        [Test]
        public void Lookup_fonts_for_glyphs()
        {
            var limit = -1;
            var icons = Enum.GetValues(typeof(IconChar)).Cast<IconChar>().Skip(1); // 1=None
            if (limit > 0) icons = icons.Take(limit);
            foreach (var icon in icons)
            {
                var fontFamily = IconHelper.FontFor(icon);
                fontFamily.Should().NotBeNull($"should lookup font for '{icon}'");
                fontFamily.Source.Should().Contain("FontAwesome.Sharp");
            }
        }

        [Test]
        public void Generate_imageSources_for_icon_chars()
        {
            var limit = -1;
            var icons = Enum.GetValues(typeof(IconChar)).Cast<IconChar>().Skip(1); // 1=None
            if (limit > 0) icons = icons.Take(limit);
            foreach (var icon in icons)
            {
                const int size = 16;
                var imageSource = icon.ToImageSource(Brushes.Black, size);
                imageSource.Should().NotBeNull($"an image should be generated for '{icon}'");
                imageSource.Should().BeOfType<DrawingImage>();
                imageSource.Width).Should().BeLessOrEqualTo(size + 1);
                imageSource.Height).Should().BeLessOrEqualTo(size + 1);
            }
        }

    }
}
{'fraction_non_alphanumeric': 0.11666243976667512, 'fraction_numerical': 0.006593963986812072, 'mean_word_length': 1.9698795180722892, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '2228437', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1075, 'n_words': 211}