Skip to content
Snippets Groups Projects
Commit c988c9cd authored by thmustap's avatar thmustap
Browse files

Testitiedostot

parent 9540c65c
No related branches found
No related tags found
No related merge requests found
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
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
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment