diff --git a/src/HT/fx/test/OtteluTest.java b/src/HT/fx/test/OtteluTest.java new file mode 100644 index 0000000000000000000000000000000000000000..7ed514a523cb6e9f85354a06d5d64b6792a3bba2 --- /dev/null +++ b/src/HT/fx/test/OtteluTest.java @@ -0,0 +1,29 @@ +package HT.fx.test; +// Generated by ComTest BEGIN +import static org.junit.Assert.*; +import org.junit.*; +import HT.fx.*; +// Generated by ComTest END + +/** + * Test class made by ComTest + * @version 2024.03.07 16:11:03 // Generated by ComTest + * + */ +@SuppressWarnings({ "all" }) +public class OtteluTest { + + + // Generated by ComTest BEGIN + /** testRekisteroi61 */ + @Test + public void testRekisteroi61() { // Ottelu: 61 + Ottelu ottelu1 = new Ottelu(); + Ottelu ottelu2 = new Ottelu(); + ottelu1.rekisteroi(); + ottelu2.rekisteroi(); + int n1 = ottelu1.getIdNro(); + int n2 = ottelu2.getIdNro(); + assertEquals("From: Ottelu line: 68", n2-n1, n1); + } // Generated by ComTest END +} \ No newline at end of file diff --git a/src/HT/fx/test/OttelutTest.java b/src/HT/fx/test/OttelutTest.java new file mode 100644 index 0000000000000000000000000000000000000000..e8e5a805de9fc6a24bc102c15bfa764a2cdb46c3 --- /dev/null +++ b/src/HT/fx/test/OttelutTest.java @@ -0,0 +1,15 @@ +package HT.fx.test; +// Generated by ComTest BEGIN +import static org.junit.Assert.*; +import org.junit.*; +import HT.fx.*; +// Generated by ComTest END + +/** + * Test class made by ComTest + * @version 2024.03.07 15:57:59 // Generated by ComTest + * + */ +@SuppressWarnings({ "all" }) +public class OttelutTest { +} \ No newline at end of file diff --git a/src/HT/fx/test/PelaajaTest.java b/src/HT/fx/test/PelaajaTest.java new file mode 100644 index 0000000000000000000000000000000000000000..35d2cb5d40d943d0646b8d2a2265cfe705f50092 --- /dev/null +++ b/src/HT/fx/test/PelaajaTest.java @@ -0,0 +1,31 @@ +package HT.fx.test; +// Generated by ComTest BEGIN +import static org.junit.Assert.*; +import org.junit.*; +import HT.fx.*; +// Generated by ComTest END + +/** + * Test class made by ComTest + * @version 2024.03.07 15:31:57 // Generated by ComTest + * + */ +@SuppressWarnings({ "all" }) +public class PelaajaTest { + + + + // Generated by ComTest BEGIN + /** testRekisteroi68 */ + @Test + public void testRekisteroi68() { // Pelaaja: 68 + Pelaaja aku1 = new Pelaaja(); + assertEquals("From: Pelaaja line: 70", 0, aku1.getTunnusNro()); + aku1.rekisteroi(); + Pelaaja aku2 = new Pelaaja(); + aku2.rekisteroi(); + int n1 = aku1.getTunnusNro(); + int n2 = aku2.getTunnusNro(); + assertEquals("From: Pelaaja line: 76", n2-1, n1); + } // Generated by ComTest END +} \ No newline at end of file diff --git a/src/HT/fx/test/PelaajatTest.java b/src/HT/fx/test/PelaajatTest.java new file mode 100644 index 0000000000000000000000000000000000000000..332d9ae7406c2c87f6efd36fa44cb4b9ca9df822 --- /dev/null +++ b/src/HT/fx/test/PelaajatTest.java @@ -0,0 +1,46 @@ +package HT.fx.test; +// Generated by ComTest BEGIN +import static org.junit.Assert.*; +import org.junit.*; +import HT.fx.*; +// Generated by ComTest END + +/** + * Test class made by ComTest + * @version 2024.03.07 15:44:17 // Generated by ComTest + * + */ +@SuppressWarnings({ "all" }) +public class PelaajatTest { + + + // Generated by ComTest BEGIN + /** + * testLisaa20 + * @throws SailoException when error + */ + @Test + public void testLisaa20() throws SailoException { // Pelaajat: 20 + Pelaajat pelaajat = new Pelaajat(); + Pelaaja aku1 = new Pelaaja(), aku2 = new Pelaaja(); + assertEquals("From: Pelaajat line: 24", 0, pelaajat.getLkm()); + pelaajat.lisaa(aku1); assertEquals("From: Pelaajat line: 25", 1, pelaajat.getLkm()); + pelaajat.lisaa(aku2); assertEquals("From: Pelaajat line: 26", 2, pelaajat.getLkm()); + pelaajat.lisaa(aku1); assertEquals("From: Pelaajat line: 27", 3, pelaajat.getLkm()); + assertEquals("From: Pelaajat line: 28", aku1, pelaajat.anna(0)); + assertEquals("From: Pelaajat line: 29", aku2, pelaajat.anna(1)); + assertEquals("From: Pelaajat line: 30", aku1, pelaajat.anna(2)); + assertEquals("From: Pelaajat line: 31", false, pelaajat.anna(1) == aku1); + assertEquals("From: Pelaajat line: 32", true, pelaajat.anna(1) == aku2); + try { + assertEquals("From: Pelaajat line: 33", aku1, pelaajat.anna(3)); + fail("Pelaajat: 33 Did not throw IndexOutOfBoundsException"); + } catch(IndexOutOfBoundsException _e_){ _e_.getMessage(); } + pelaajat.lisaa(aku1); assertEquals("From: Pelaajat line: 34", 4, pelaajat.getLkm()); + pelaajat.lisaa(aku1); assertEquals("From: Pelaajat line: 35", 5, pelaajat.getLkm()); + try { + pelaajat.lisaa(aku1); + fail("Pelaajat: 36 Did not throw SailoException"); + } catch(SailoException _e_){ _e_.getMessage(); } + } // Generated by ComTest END +} \ No newline at end of file