Commit 979c233c authored by Arne Schmidt's avatar Arne Schmidt
Browse files

Test geändert

parent d9623af3
.gradle/ .gradle/
/bin/
...@@ -5,11 +5,11 @@ package de.hochschule_trier.sis; ...@@ -5,11 +5,11 @@ package de.hochschule_trier.sis;
* *
*/ */
public class App { public class App {
public static void main( String[] args ) { public static void main(String[] args) {
System.out.println( "Hello World!" ); System.out.println("Hello World!");
} }
public int one() { public boolean maybe() {
return (int) Math.round(Math.random()); return ((int) Math.round(Math.random()) == 1);
} }
} }
...@@ -7,33 +7,29 @@ import junit.framework.TestSuite; ...@@ -7,33 +7,29 @@ import junit.framework.TestSuite;
/** /**
* Unit test for simple App. * Unit test for simple App.
*/ */
public class AppTest public class AppTest extends TestCase {
extends TestCase /**
{ * Create the test case
/** *
* Create the test case * @param testName
* * name of the test case
* @param testName name of the test case */
*/ public AppTest(String testName) {
public AppTest( String testName ) super(testName);
{ }
super( testName );
}
/** /**
* @return the suite of tests being tested * @return the suite of tests being tested
*/ */
public static Test suite() public static Test suite() {
{ return new TestSuite(AppTest.class);
return new TestSuite( AppTest.class ); }
}
/** /**
* Rigourous Test :-) * Rigourous Test :-)
*/ */
public void testApp() public void testApp() {
{ App app = new App();
App app = new App(); assertTrue(app.maybe());
assertEquals(1, app.one()); }
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment