Ejemplo n.º 1
0
  @Test
  public final void testIsAllowed_NoComponentSupport() {
    Item item = Mockito.mock(Item.class);
    Mockito.when(item.getHardpointType()).thenReturn(HardPointType.NONE);
    Mockito.when(item.getFaction()).thenReturn(Faction.Clan);
    Mockito.when(item.isCompatible(Matchers.any(Upgrades.class))).thenReturn(true);

    ChassisOmniMech cut = makeDefaultCUT();
    assertTrue(cut.isAllowed(item)); // Item in it self is allowed

    // But no component supports it.
    for (Location location : Location.values()) {
      Mockito.when(components[location.ordinal()].isAllowed(item, null)).thenReturn(false);
    }
    assertFalse(cut.isAllowed(item));
  }
Ejemplo n.º 2
0
  @Test
  public final void testIsAllowed_CASE() {
    Item item = ItemDB.CASE;

    ChassisOmniMech cut = makeDefaultCUT();
    assertFalse(cut.isAllowed(item));
  }