-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement two equals methods, add Junit lib
- Loading branch information
Showing
10 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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,42 @@ | ||
package entity; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import static entity.PokemonType.ELECTRICITY; | ||
import static org.junit.Assert.*; | ||
|
||
public class BasePokemonDataTest { | ||
BasePokemonData basePokemonData; | ||
|
||
@Before | ||
public void setBasePokemon(){ | ||
basePokemonData = new BasePokemonData(ELECTRICITY, 1,1,1,1); | ||
} | ||
|
||
@Test(timeout = 50) | ||
public void testGetPokemonType() { | ||
assertEquals(ELECTRICITY, basePokemonData.getPokemonType()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetMaxHitPoint() { | ||
assertEquals(1, basePokemonData.getMaxHitPoint()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetAttackPoint() { | ||
assertEquals(1, basePokemonData.getAttackPoint()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetDefencePoint() { | ||
assertEquals(1, basePokemonData.getDefencePoint()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetSpeed() { | ||
assertEquals(1, basePokemonData.getSpeed()); | ||
} | ||
@Test(timeout = 50) | ||
public void testEqual(){ | ||
BasePokemonData bpd = new BasePokemonData(ELECTRICITY, 1,1,1,1); | ||
assertTrue(basePokemonData.equals(bpd)); | ||
} | ||
} |
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,50 @@ | ||
package entity; | ||
|
||
import org.junit.*; | ||
import static entity.PokemonType.ELECTRICITY; | ||
import static org.junit.Assert.*; | ||
|
||
public class BasePokemonTest { | ||
BasePokemon basePokemon; | ||
|
||
@Before | ||
public void setBasePokemon(){ | ||
BasePokemonData bpd = new BasePokemonData(ELECTRICITY, 1,1,1,1); | ||
basePokemon = new BasePokemon("test",bpd); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetName() { | ||
assertEquals("test", basePokemon.getName()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetBasePokemonData() { | ||
BasePokemonData bpd = new BasePokemonData(ELECTRICITY, 1,1,1,1); | ||
assertEquals(bpd, basePokemon.getBasePokemonData()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetPokemonType() { | ||
assertEquals(ELECTRICITY, basePokemon.getPokemonType()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetMaxHitPoint() { | ||
assertEquals(1, basePokemon.getMaxHitPoint()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetAttackPoint() { | ||
assertEquals(1, basePokemon.getAttackPoint()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetDefencePoint() { | ||
assertEquals(1, basePokemon.getDefencePoint()); | ||
} | ||
@Test(timeout = 50) | ||
public void testGetSpeed() { | ||
assertEquals(1, basePokemon.getSpeed()); | ||
} | ||
@Test(timeout = 50) | ||
public void testEqual() { | ||
BasePokemonData bpd = new BasePokemonData(ELECTRICITY, 1,1,1,1); | ||
BasePokemon bp = new BasePokemon("test", bpd); | ||
assertTrue(basePokemon.equals(bp)); | ||
} | ||
} |