Package games.stendhal.common.parser

Source Code of games.stendhal.common.parser.WordEntryTest

/* $Id: WordEntryTest.java,v 1.1 2011/05/01 19:41:43 martinfuchs Exp $ */
/***************************************************************************
*                   (C) Copyright 2003-2010 - Stendhal                    *
***************************************************************************
***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
***************************************************************************/
package games.stendhal.common.parser;

import static org.junit.Assert.assertEquals;
import games.stendhal.common.parser.ExpressionType;
import games.stendhal.common.parser.WordEntry;

import org.junit.Test;

/**
* Test the NPC conversation WordEntry class.
*
* @author Martin Fuchs
*/
public class WordEntryTest {

  @Test
  public final void testWordEntry() {
    final WordEntry w = new WordEntry();
    assertEquals("/", w.getNormalizedWithTypeString());
    assertEquals("/", w.toString());

    w.setNormalized("norm");
    w.setPlurSing("plur");
    assertEquals("norm/", w.getNormalizedWithTypeString());
    assertEquals("norm/", w.toString());

    w.setType(new ExpressionType("TYP"));
    w.setValue(4711);
    assertEquals("norm/TYP", w.getNormalizedWithTypeString());
    assertEquals("norm/TYP", w.toString());
  }

}
TOP

Related Classes of games.stendhal.common.parser.WordEntryTest

TOP
Copyright © 2018 www.massapi.com. 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.