/*
+++++++++++++++++++++++++++++++++++++++++++
title     Hashids Public API Test         +
project   icecore-hashids                 +
file      HashidsTest.java                +
version                                   +
author    Arctic Ice Studio               +
email     development@arcticicestudio.com +
website   http://arcticicestudio.com      +
copyright Copyright (C) 2016              +
created   2016-06-06 21:05 UTC+0200       +
modified  2016-06-06 21:06 UTC+0200       +
+++++++++++++++++++++++++++++++++++++++++++

[Description]
Tests the "IceCore - Hashids" public API class "Hashids".

[Copyright]
Copyright (C) 2016 Arctic Ice Studio <development@arcticicestudio.com>

[References]
Hashids
  (http://hashids.org)
Java 8 API Documentation
  (https://docs.oracle.com/javase/8/docs/api/)
Arctic Versioning Specification (ArcVer)
  (http://specs.arcticicestudio.com/arcver)
*/
package com.arcticicestudio.icecore.hashids;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

import org.junit.Test;

/**
 * Tests the <a href="https://bitbucket.org/arcticicestudio/icecore-hashids">IceCore - Hashids</a>
 * public API class {@link Hashids}.
 *
 * @author Arctic Ice Studio &lt;development@arcticicestudio.com&gt;
 * @see <a href="https://bitbucket.org/arcticicestudio/icecore-hashids">IceCore - Hashids</a>
 * @see <a href="http://hashids.org">Hashids</a>
 * @since 0.1.0
 */
public class HashidsTest {

  @Test
  public void oneLongNumber() {
    Hashids hashids = new Hashids("salt");
    long number = 12_345L;
    String expected = "X4j1";
    long[] decoded = hashids.decodeLongNumbers(hashids.encodeToString(number));

    assertEquals(hashids.encodeToString(number), expected);
    assertEquals(decoded.length, 1);
    assertEquals(decoded[0], number);
  }

  @Test
  public void oneLongNumberWithCustomMinimumHashLength() {
    Hashids hashids = new Hashids("salt", 8);
    long number = 12_345L;
    String expected = "xkX4j1kZ";
    long[] decoded = hashids.decodeLongNumbers(hashids.encodeToString(number));

    assertEquals(hashids.encodeToString(number), expected);
    assertEquals(decoded.length, 1);
    assertEquals(decoded[0], number);
  }

  @Test
  public void oneLongNumberWithCustomAlphabet() {
    Hashids hashids = new Hashids("salt", "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789");
    long number = 12_345L;
    String expected = "KQL1R";
    long[] decoded = hashids.decodeLongNumbers(hashids.encodeToString(number));

    assertEquals(expected, hashids.encodeToString(number));
    assertEquals(decoded.length, 1);
    assertEquals(decoded[0], number);
  }

  @Test
  public void oneIntegerNumber() {
    Hashids hashids = new Hashids("salt");
    int number = 12_345;
    String expected = "X4j1";
    int[] decoded = hashids.decodeIntegerNumbers(hashids.encodeToString(number));

    assertEquals(hashids.encodeToString(number), expected);
    assertEquals(decoded.length, 1);
    assertEquals(decoded[0], number);
  }

  @Test
  public void oneIntegerNumberWithCustomMinimumHashLength() {
    Hashids hashids = new Hashids("salt", 8);
    int number = 12345;
    String expected = "xkX4j1kZ";
    int[] decoded = hashids.decodeIntegerNumbers(hashids.encodeToString(number));

    assertEquals(hashids.encodeToString(number), expected);
    assertEquals(decoded.length, 1);
    assertEquals(decoded[0], number);
  }

  @Test
  public void oneIntegerNumberWithCustomAlphabet() {
    Hashids hashids = new Hashids("salt", "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789");
    int number = 12_345;
    String expected = "KQL1R";
    int[] decoded = hashids.decodeIntegerNumbers(hashids.encodeToString(number));

    assertEquals(expected, hashids.encodeToString(number));
    assertEquals(decoded.length, 1);
    assertEquals(decoded[0], number);
  }

  @Test
  public void severalLongNumbers() {
    Hashids hashids = new Hashids("salt");
    long[] numbers = {683L, 94_108L, 123L, 5L};
    String expected = "1eMToyKzsRAfO";
    long[] decoded = hashids.decodeLongNumbers(hashids.encodeToString(numbers));

    assertEquals(hashids.encodeToString(numbers), expected);
    assertEquals(decoded.length, numbers.length);
    assertArrayEquals(decoded, numbers);
  }

  @Test
  public void severalLongNumberWithCustomMinimumHashLength() {
    Hashids hashids = new Hashids("salt", 8);
    long[] numbers = {683L, 94_108L, 123L, 5L};
    String expected = "1eMToyKzsRAfO";
    long[] decoded = hashids.decodeLongNumbers(hashids.encodeToString(numbers));

    assertEquals(expected, hashids.encodeToString(numbers));
    assertEquals(decoded.length, numbers.length);
    assertArrayEquals(decoded, numbers);
  }

  @Test
  public void severalLongNumbersWithCustomAlphabet() {
    Hashids hashids = new Hashids("salt", "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789");
    long[] numbers = {683L, 94_108L, 123L, 5L};
    String expected = "3L4DTV52JC4KAJ";
    long[] decoded = hashids.decodeLongNumbers(hashids.encodeToString(numbers));

    assertEquals(expected, hashids.encodeToString(numbers));
    assertEquals(decoded.length, numbers.length);
    assertArrayEquals(decoded, numbers);
  }

  @Test
  public void severalIntegerNumbers() {
    Hashids hashids = new Hashids("salt");
    int[] numbers = {683, 94_108, 123, 5};
    String expected = "1eMToyKzsRAfO";
    int[] decoded = hashids.decodeIntegerNumbers(hashids.encodeToString(numbers));

    assertEquals(hashids.encodeToString(numbers), expected);
    assertEquals(decoded.length, numbers.length);
    assertArrayEquals(decoded, numbers);
  }
}

@@ -5551,11 +5551,455 @@
 rs);%0A  %7D
+%0A%0A  @Test%0A  public void severalIntegerNumbersWithCustomMinimumHashLength() %7B%0A    Hashids hashids = new Hashids(%22salt%22, 8);%0A    int%5B%5D numbers = %7B683, 94_108, 123, 5%7D;%0A    String expected = %221eMToyKzsRAfO%22;%0A    int%5B%5D decoded = hashids.decodeIntegerNumbers(hashids.encodeToString(numbers));%0A%0A    assertEquals(expected, hashids.encodeToString(numbers));%0A    assertEquals(decoded.length, numbers.length);%0A    assertArrayEquals(decoded, numbers);%0A  %7D
 %0A%7D%0A

Implement test method "+ severalIntegerNumbersWithCustomMinimumHashLength():void"