コード例 #1
0
 @Test
 public void testCemNaoPrimo() {
   int[] a = new int[120];
   Primos.crivoEratostenes(a);
   Assert.assertEquals(1, a[100]);
 }
コード例 #2
0
 @Test(expected = IllegalArgumentException.class)
 public void testVetorPovoadoCrivo() {
   int[] a = {1, 2, 0, 5, 7, 9, 2};
   Primos.crivoEratostenes(a);
 }
コード例 #3
0
 @Test
 public void testDoisPrimoCrivo() {
   int[] a = new int[3];
   Primos.crivoEratostenes(a);
   Assert.assertEquals(0, a[2]);
 }
コード例 #4
0
 @Test(expected = IllegalArgumentException.class)
 public void testVetorTamanhoInvalidoCrivo() {
   Primos.crivoEratostenes(new int[] {1});
 }