Beispiel #1
0
  /** Initialize mocks. */
  @Before
  public void start() {
    MockitoAnnotations.initMocks(this);
    action = new Morph(bwapi);

    params = new LinkedList<>();
    params.add(new Identifier("Zerg Hydralisk"));
    params.add(new Numeral(2));

    when(act.getParameters()).thenReturn(params);
    when(unit.getType()).thenReturn(unitType);
    when(bwapi.getSelf()).thenReturn(player);
  }
Beispiel #2
0
  @Test
  public void test() throws NoTranslatorException, TranslationException {
    MockitoAnnotations.initMocks(this);
    locations = new LinkedList<>();
    locations.add(loc1);
    locations.add(loc2);

    when(bwapi.getMap()).thenReturn(map);
    when(map.getBaseLocations()).thenReturn(locations);
    when(loc2.isStartLocation()).thenReturn(true);

    draw = new DrawBases(null);
    draw.toggle();
    draw.draw(bwapi);

    verify(bwapi, times(2)).drawCircle(null, 75, BWColor.Purple, false, false);
    verify(bwapi, times(1)).drawText(null, "Starting Location", false);

    draw.toggle();
    draw.draw(bwapi);

    verify(bwapi, times(2)).drawCircle(null, 75, BWColor.Purple, false, false);
    verify(bwapi, times(1)).drawText(null, "Starting Location", false);
  }