Search in sources :

Example 41 with SOCResourceSet

use of soc.game.SOCResourceSet in project JSettlers2 by jdmonin.

the class TestResourceSet method removeAll_yieldsEmptyResourceSet.

@Test
public void removeAll_yieldsEmptyResourceSet() {
    SOCResourceSet rs = onePerType();
    rs.subtract(1, SOCResourceConstants.CLAY);
    rs.subtract(1, SOCResourceConstants.WHEAT);
    rs.subtract(1, SOCResourceConstants.WOOD);
    rs.subtract(1, SOCResourceConstants.ORE);
    rs.subtract(1, SOCResourceConstants.SHEEP);
    assertEquals(0, rs.getTotal());
}
Also used : SOCResourceSet(soc.game.SOCResourceSet) Test(org.junit.Test)

Example 42 with SOCResourceSet

use of soc.game.SOCResourceSet in project JSettlers2 by jdmonin.

the class TestResourceSet method clone_isContained.

@Test
public void clone_isContained() {
    SOCResourceSet rs1 = onePerType();
    SOCResourceSet rs2 = onePerType();
    assertTrue(rs1.contains(rs2));
}
Also used : SOCResourceSet(soc.game.SOCResourceSet) Test(org.junit.Test)

Example 43 with SOCResourceSet

use of soc.game.SOCResourceSet in project JSettlers2 by jdmonin.

the class TestResourceSet method clear_yieldsEmptyResourceSet.

@Test
public void clear_yieldsEmptyResourceSet() {
    SOCResourceSet rs = onePerType();
    rs.clear();
    assertEquals(0, rs.getTotal());
}
Also used : SOCResourceSet(soc.game.SOCResourceSet) Test(org.junit.Test)

Example 44 with SOCResourceSet

use of soc.game.SOCResourceSet in project JSettlers2 by jdmonin.

the class TestResourceSet method removeOneResource_removesOneResource.

@Test
public void removeOneResource_removesOneResource() {
    SOCResourceSet rs = onePerType();
    rs.subtract(1, SOCResourceConstants.ORE);
    assertEquals(4, rs.getTotal());
}
Also used : SOCResourceSet(soc.game.SOCResourceSet) Test(org.junit.Test)

Example 45 with SOCResourceSet

use of soc.game.SOCResourceSet in project JSettlers2 by jdmonin.

the class TestResourceSet method total_test.

@Test
public void total_test() {
    SOCResourceSet rs = onePerType();
    assertEquals(5, rs.getTotal());
}
Also used : SOCResourceSet(soc.game.SOCResourceSet) Test(org.junit.Test)

Aggregations

SOCResourceSet (soc.game.SOCResourceSet)54 Test (org.junit.Test)14 SOCTradeOffer (soc.game.SOCTradeOffer)10 SOCPlayer (soc.game.SOCPlayer)8 Stack (java.util.Stack)4 SOCShip (soc.game.SOCShip)3 ArrayList (java.util.ArrayList)2 StringTokenizer (java.util.StringTokenizer)2 SOCBoardLarge (soc.game.SOCBoardLarge)2 SOCGame (soc.game.SOCGame)2 SOCRoad (soc.game.SOCRoad)2 Queue (soc.util.Queue)2 Hashtable (java.util.Hashtable)1 Iterator (java.util.Iterator)1 List (java.util.List)1 MissingResourceException (java.util.MissingResourceException)1 Vector (java.util.Vector)1 SOCInventoryItem (soc.game.SOCInventoryItem)1 SOCLRPathData (soc.game.SOCLRPathData)1 SOCSpecialItem (soc.game.SOCSpecialItem)1