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