Package games.stendhal.client

Examples of games.stendhal.client.MockStendhalClient


  /**
   * Tests for execute.
   */
  @Test
  public void testExecute() {
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        assertEquals("alterquest", action.get("type"));
        assertEquals("schnick", action.get("target"));
        assertEquals("schnack", action.get("name"));
        assertEquals("schnuck", action.get("state"));
       
      }
    };
    final AlterQuestAction action = new AlterQuestAction();
    assertFalse(action.execute(null, null));
    assertFalse(action.execute(new String[] { "schnick" }, null));
    assertTrue(action.execute(new String[] { "schnick", "schnack", "schnuck" }, null));

    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        assertEquals("alterquest", action.get("type"));
        assertEquals("schnick", action.get("target"));
        assertEquals("schnick", action.get("name"));
View Full Code Here


  /**
   * Tests for execute.
   */
  @Test
  public void testExecute() {
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        assertEquals("answer", action.get("type"));
        assertEquals("schnick", action.get("text"));

View Full Code Here

  /**
   * Tests for execute.
   */
  @Test
  public void testExecute() {
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        assertEquals("away", action.get("type"));
        assertEquals("schnick", action.get("message"));
      }
View Full Code Here

  /**
   * Tests for execute.
   */
  @Test
  public void testExecute() {
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        assertEquals("alter", action.get("type"));
        assertEquals("schnick", action.get("target"));
        assertEquals("schnack", action.get("stat"));
View Full Code Here

  /**
   * Tests for execute.
   */
  @Test
  public void testExecute() {
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        assertEquals("altercreature", action.get("type"));
        assertEquals("schnick", action.get("target"));
        assertEquals("schnack", action.get("text"));
View Full Code Here

  /**
   * Tests for execute.
   */
  @Test
  public void testExecute() {
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        assertEquals("addbuddy", action.get("type"));
        assertEquals("schnick", action.get("target"));
      }
View Full Code Here

  /**
   * Tests for execute.
   */
  @Test
  public void testExecute() {
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        for (final String attrib : action) {
          assertEquals("type", attrib);
          assertEquals("who", (action.get(attrib)));
View Full Code Here

  public void testDropSingle() {
    // create client UI
    final MockClientUI clientUI = new MockClientUI();

    // create client
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        client = null;
        assertEquals("drop", action.get("type"));
        assertEquals(USER_ID, action.getInt("baseobject"));
View Full Code Here

  public void testDropMultiple() {
    // create client UI
    final MockClientUI clientUI = new MockClientUI();

    // create client
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        client = null;
        assertEquals("drop", action.get("type"));
        assertEquals(USER_ID, action.getInt("baseobject"));
View Full Code Here

  public void testSpaceHandling() {
    // create client UI
    final MockClientUI clientUI = new MockClientUI();

    // create client
    new MockStendhalClient() {
      @Override
      public void send(final RPAction action) {
        client = null;
        assertEquals("drop", action.get("type"));
        assertEquals(USER_ID, action.getInt("baseobject"));
View Full Code Here

TOP

Related Classes of games.stendhal.client.MockStendhalClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.