mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 20:59:07 +00:00
Test done
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package units;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Created by Srdjan on 03-May-17.
|
||||
*/
|
||||
public class UnitTest {
|
||||
|
||||
private Unit unit;
|
||||
|
||||
@Test
|
||||
public void testConstGetSet() throws Exception {
|
||||
final String name = "testName";
|
||||
final Unit unit = new Unit(name);
|
||||
assertEquals(name,unit.getName());
|
||||
|
||||
final String newName = "newName";
|
||||
unit.setName(newName);
|
||||
assertEquals(newName,unit.getName());
|
||||
|
||||
|
||||
assertNull(unit.getUnitExtension(""));
|
||||
assertNull(unit.getUnitExtension("SoldierExtension"));
|
||||
assertNull(unit.getUnitExtension("SergeantExtension"));
|
||||
assertNull(unit.getUnitExtension("CommanderExtension"));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user