Package games.stendhal.common.account

Source Code of games.stendhal.common.account.MinLengthValidatorTest

/* $Id: MinLengthValidatorTest.java,v 1.6 2010/09/19 02:37:56 nhnb 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.account;

import games.stendhal.server.core.account.MinLengthValidator;

import org.junit.Assert;
import org.junit.Test;


public class MinLengthValidatorTest {

  /**
   * Tests for emptyString.
   */
  @Test
  public void testEmptyString() {
    final MinLengthValidator validator = new MinLengthValidator("", 4);
    Assert.assertNotNull(validator.validate());
  }

  /**
   * Tests for shortString.
   */
  @Test
  public void testShortString() {
    final MinLengthValidator validator = new MinLengthValidator("asd", 4);
    Assert.assertNotNull(validator.validate());
  }

  /**
   * Tests for oKString.
   */
  @Test
  public void testOKString() {
    final MinLengthValidator validator = new MinLengthValidator("asdf", 4);
    Assert.assertNull(validator.validate());
  }
}
TOP

Related Classes of games.stendhal.common.account.MinLengthValidatorTest

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.