/**
 *
 */
package com.github.apixandru.games.rummikub;

import java.util.Arrays;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;

/**
 * @author Alexandru-Constantin Bledea
 * @since Sep 17, 2015
 */
@SuppressWarnings ("static-method")
public final class CardsTest {

	/**
	 *
	 */
	@Test
	public void testIsAscendingRanks() {
		final List<Card> cards = Arrays.asList(new Card(Color.RED, Rank.ONE), new Card(Color.RED, Rank.TWO), new Card(Color.RED, Rank.THREE));
		Assert.assertTrue("Cards should be in ascending order", Cards.isAscendingRanks(cards));
	}

	/**
	 *
	 */
	@Test
	public void testIsAscendingRanksWithJoker() {
		final List<Card> cards = Arrays.asList(new Card(Color.RED, Rank.ONE), new Card(null, null), new Card(Color.RED, Rank.THREE));
		Assert.assertTrue("Cards should be in ascending order", Cards.isAscendingRanks(cards));
	}

	/**
	 *
	 */
	@Test
	public void testIsAscendingRanksWithJokerBad() {
		final List<Card> cards = Arrays.asList(new Card(Color.RED, Rank.ONE), new Card(null, null), new Card(Color.RED, Rank.FOUR));
		Assert.assertFalse("Cards should not be in ascending order", Cards.isAscendingRanks(cards));
	}

	/**
	 *
	 */
	@Test
	public void testIsAscendingRanksBad() {
		final List<Card> cards = Arrays.asList(new Card(Color.RED, Rank.TWELVE), new Card(Color.RED, Rank.THIRTEEN), new Card(Color.RED, Rank.ONE));
		Assert.assertFalse("Cards should not be in ascending order", Cards.isAscendingRanks(cards));
	}

}

@@ -1467,10 +1467,287 @@
 ));%0A%09%7D%0A%0A
+%09/**%0A%09 *%0A%09 */%0A%09@Test%0A%09public void testIsAscendingRanksDoubleJoker() %7B%0A%09%09final List%3CCard%3E cards = Arrays.asList(new Card(null, null), new Card(null, null), new Card(Color.RED, Rank.THREE));%0A%09%09Assert.assertTrue(%22Jokers should map to 1 and 2%22, Cards.isAscendingRanks(cards));%0A%09%7D%0A%0A
 %7D%0A

add test to match first 2 jokers