<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentAssertions;
using Moq;
using Xunit;

namespace HashidsNet.test
{
    public class Hashids_test
    {
        private const string salt = "this is my salt";
        private const string defaultAlphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
        private const string defaultSeps = "cfhistuCFHISTU";

        private readonly Hashids hashids;

        public Hashids_test()
        {
            hashids = new Hashids(salt);
        }

        [Fact]
        void it_has_correct_default_alphabet()

        [Fact]
        public void MaxInt64_Encodes()
        {
            var source = new[] { 35887507618889472L, 30720L, long.MaxValue };
            var encoded = hashids.EncodeLong(source);
            var result = hashids.DecodeLong(encoded);

            source.Should().BeEquivalentTo(result);
        }


        [Fact]
        public void AlphabetWithDashes_Encodes()
        {
            var customHashids = new Hashids(alphabet: "abcdefghijklmnopqrstuvwxyz1234567890_-");
            var source = new long[] { 1, 2, 3 };
            var encoded = customHashids.EncodeLong(source);
            var result = customHashids.DecodeLong(encoded);

            source.Should().BeEquivalentTo(result);
        }

        [Fact]
        public void GuardCharacterOnly_DecodesToEmptyArray()
        {
            // no salt creates guard characters: "abde"
            var customHashids = new Hashids("");
            var decodedValue = customHashids.Decode("a");<commit_msg>Fix tests.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentAssertions;
using Moq;
using Xunit;

namespace HashidsNet.test
{
    public class Hashids_test
    {
        private const string salt = "this is my salt";
        private const string defaultAlphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
        private const string defaultSeps = "cfhistuCFHISTU";

        private readonly Hashids hashids;

        public Hashids_test()
        {
            hashids = new Hashids(salt);
        }

        [Fact]
        public void MaxInt64_Encodes()
        {
            var source = new[] { 35887507618889472L, 30720L, long.MaxValue };
            var encoded = hashids.EncodeLong(source);
            var result = hashids.DecodeLong(encoded);

            source.Should().BeEquivalentTo(result);
        }


        [Fact]
        public void AlphabetWithDashes_Encodes()
        {
            var customHashids = new Hashids(alphabet: "abcdefghijklmnopqrstuvwxyz1234567890_-");
            var source = new long[] { 1, 2, 3 };
            var encoded = customHashids.EncodeLong(source);
            var result = customHashids.DecodeLong(encoded);

            source.Should().BeEquivalentTo(result);
        }

        [Fact]
        public void GuardCharacterOnly_DecodesToEmptyArray()
        {
            // no salt creates guard characters: "abde"
            var customHashids = new Hashids("");
            var decodedValue = customHashids.Decode("a");
{'fraction_non_alphanumeric': 0.08527375707992448, 'fraction_numerical': 0.02957835116425425, 'mean_word_length': 2.3427970557308098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4635249', 'n_tokens_mistral': 986, 'n_tokens_neox': 892, 'n_words': 209}