Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>tr.edu.medipol</groupId> | ||
<artifactId>YazilimAraclariParent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>Ders3Proje</artifactId> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.6</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
13 changes: 13 additions & 0 deletions
13
YazilimAraclariParent/Ders3Proje/src/main/java/tr/edu/medipol/Hesaplama.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package tr.edu.medipol; | ||
|
||
public class Hesaplama { | ||
|
||
public int topla(int sayi1, int sayi2) { | ||
return sayi1 + sayi2; | ||
} | ||
|
||
public int bol(int sayi1, int sayi2) { | ||
return sayi1 / sayi2; | ||
} | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
YazilimAraclariParent/Ders3Proje/src/test/java/tr/edu/medipol/HesaplamaTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package tr.edu.medipol; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.After; | ||
import org.junit.AfterClass; | ||
import org.junit.Before; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
public class HesaplamaTest { | ||
|
||
private static Hesaplama h; | ||
|
||
@BeforeClass | ||
public static void setUpBeforeClass() throws Exception { | ||
System.out.println(">>> TESTLER BASLIYOR >>>"); | ||
h = new Hesaplama(); | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownAfterClass() throws Exception { | ||
h = null; | ||
System.out.println("<<< TESTLER BITIYOR <<<"); | ||
} | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
System.out.println("Unit test basliyor ...."); | ||
} | ||
|
||
@After | ||
public void tearDown() throws Exception { | ||
System.out.println("Unit test bitiyor ...."); | ||
} | ||
|
||
@Test | ||
public final void testTopla2Arti2() { | ||
int sonuc = h.topla(2, 2); | ||
assertEquals("2 artı 2 = 4 olmali", 4, sonuc); | ||
} | ||
|
||
@Test | ||
public final void testToplaNegatifSayilar() { | ||
for (int a = -10000; a < 0; a++) { | ||
for (int b = -10000; b < 0; b++) { | ||
int sonuc = h.topla(a, b); | ||
assertEquals(a+b, sonuc); | ||
assertEquals(Math.addExact(a, b), sonuc); | ||
} | ||
|
||
} | ||
} | ||
|
||
@Test | ||
public final void testToplaPozitifSayilar() { | ||
fail("Not yet implemented"); | ||
} | ||
|
||
@Test | ||
public final void testBol() { | ||
fail("Not yet implemented"); | ||
} | ||
|
||
@Test | ||
public final void testHashCode() { | ||
fail("Not yet implemented"); | ||
} | ||
|
||
@Test | ||
public final void testEquals() { | ||
fail("Not yet implemented"); | ||
} | ||
|
||
@Test | ||
public final void testToString() { | ||
fail("Not yet implemented"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>tr.edu.medipol</groupId> | ||
<artifactId>YazilimAraclariParent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
<modules> | ||
<module>Ders3Proje</module> | ||
</modules> | ||
</project> |