示例#1
0
 @Test
 public void puttingResourcesWontWorkWithNegativeNumbers() {
   Treasury t = new Treasury("Treasury", r);
   t.putResource(Resource.GOLD, -20);
   assertEquals(t.getResourceAmount(Resource.GOLD), 100);
 }
示例#2
0
 @Test
 public void takeResourceDoesntWorkWithNegativeNumbers() {
   Treasury t = new Treasury("Treasury", r);
   t.takeResource(Resource.GOLD, -20);
   assertEquals(t.getResourceAmount(Resource.GOLD), 100);
 }
示例#3
0
 @Test
 public void takeResourceWontBringResourcesToNegative() {
   Treasury t = new Treasury("Treasury", r);
   t.takeResource(Resource.GOLD, 110);
   assertEquals(100, t.getResourceAmount(Resource.GOLD));
 }
示例#4
0
 @Test
 public void takeResourceGetsGold() {
   Treasury t = new Treasury("Treasury", r);
   t.takeResource(Resource.GOLD, 20);
   assertEquals(t.getResourceAmount(Resource.GOLD), 80);
 }