package permutation;

import static org.junit.Assert.*;

import org.junit.Test;


public class TestPermutation {
	
	// Question 3 
	@Test
	public void testT1() throws TestException {
		int [ ] x = { 1, 3, 4 };
		assertEquals(false, Permutation.Permutation(x));
	}

	@Test
	public void testT3() throws TestException {
		int [ ] x = { 1, 0, 2 };
		assertEquals(true, Permutation.Permutation(x));
	}
	
	// Question 4 
	@Test
	public void testDoublon() throws TestException {
		int [ ] x = { 1, 2, 2 };
		assertEquals(false, Permutation.Permutation(x));
	}
	
	@Test
	public void testNegatif() throws TestException {
		int [ ] x = { -1, 0, 1 };
		assertEquals(false, Permutation.Permutation(x));
	}
	
	// Question 5 
	@Test(expected = IllegalArgumentException.class)
	public void nullArray() {
		Permutation.Permutation(null);
	}
}
