import junit.framework.TestCase; public class MatriceTest extends TestCase { public void testMultiDimensionDiff() { int m1[][] = {{2, 1, 3}, {3, 4, 1}}; int m2[][] = {{1, 1}, {1, 1}}; try { Matrice.mult(m1, m2); fail(); } catch (Exception e) { assertTrue(true); } } public void testMultResultat() { int m1[][] = {{2, 1}, {3, 4}}; int m2[][] = {{1, 1}, {1, 1}}; try { int r[][] = Matrice.mult(m1, m2); assertTrue(r[0][0] == 3 && r[0][1] == 3 && r[1][0] == 7 && r[1][1] == 7); } catch (Exception e) { fail(); } } }