<commit_before>﻿using System;
using NUnit.Framework;
using rm.Extensions;

namespace rm.ExtensionsTest
{
    [TestFixture]
    public class UriExtensionTest
    {
        [Test]
        [TestCase("https://scontent-a-sjc.xx.fbcdn.net/hphotos-ash2/t1.0-9/206120_10150185038165390_6567409_n.jpg", Hasher.sha1, "9ca6c1c83f07a42dc5549bc2ba0b2079686d0e12")]
        [TestCase("https://scontent-a-sjc.xx.fbcdn.net/hphotos-ash2/t1.0-9/206120_10150185038165390_6567409_n.jpg", Hasher.md5, "131b39ae30d4d55db34f5a03cd6ce1f8")]
        [TestCase(@"./images/d s .jpg", Hasher.sha1, "9ca6c1c83f07a42dc5549bc2ba0b2079686d0e12")]
        [TestCase(@"./images/d s .jpg", Hasher.md5, "131b39ae30d4d55db34f5a03cd6ce1f8")]
        public void Checksum01(string url_or_path, Hasher type, string hash)
        {
            Uri uri;
            if (url_or_path.StartsWith("."))
            {
                var path = url_or_path;
                uri = new Uri(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase), path);
            }
            else
            {
                var url = url_or_path;
                uri = new Uri(url);
            }
            var h = uri.Checksum(type);
            Console.WriteLine(h);
            Assert.AreEqual(hash, h);
        }
    }
}
<commit_msg>Fix: Fixing test for Checksum() method.<commit_after>﻿using System;
using NUnit.Framework;
using rm.Extensions;

namespace rm.ExtensionsTest
{
    [TestFixture]
    public class UriExtensionTest
    {
        [Test]
        [TestCase("https://scontent-a-sea.xx.fbcdn.net/hphotos-xaf1/v/t1.0-9/206120_10150185038165390_6567409_n.jpg?oh=d12c6b8e05336e671e07992b68c1d14f&oe=550ECB05", Hasher.sha1, "9ca6c1c83f07a42dc5549bc2ba0b2079686d0e12")]
        [TestCase("https://scontent-a-sea.xx.fbcdn.net/hphotos-xaf1/v/t1.0-9/206120_10150185038165390_6567409_n.jpg?oh=d12c6b8e05336e671e07992b68c1d14f&oe=550ECB05", Hasher.md5, "131b39ae30d4d55db34f5a03cd6ce1f8")]
        [TestCase(@"./images/d s .jpg", Hasher.sha1, "9ca6c1c83f07a42dc5549bc2ba0b2079686d0e12")]
        [TestCase(@"./images/d s .jpg", Hasher.md5, "131b39ae30d4d55db34f5a03cd6ce1f8")]
        public void Checksum01(string url_or_path, Hasher type, string hash)
        {
            Uri uri;
            if (url_or_path.StartsWith("."))
            {
                var path = url_or_path;
                uri = new Uri(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase), path);
            }
            else
            {
                var url = url_or_path;
                uri = new Uri(url);
            }
            var h = uri.Checksum(type);
            Console.WriteLine(h);
            Assert.AreEqual(hash, h);
        }
    }
}

{'fraction_non_alphanumeric': 0.12020648967551623, 'fraction_numerical': 0.137905604719764, 'mean_word_length': 2.4040150564617315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '915121', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1032, 'n_words': 129}