ChineseTextProducerTest.java :  » J2EE » SimpleCaptcha-1.1.1 » nl » captcha » text » producer » Java Open Source

Java Open Source » J2EE » SimpleCaptcha 1.1.1 
SimpleCaptcha 1.1.1 » nl » captcha » text » producer » ChineseTextProducerTest.java
package nl.captcha.text.producer;

import static nl.captcha.text.producer.ChineseTextProducer.*;
import static org.junit.Assert.*;

import nl.captcha.text.producer.ChineseTextProducer;

import org.junit.Test;
public class ChineseTextProducerTest {
  
  @Test
  public void testDefaultConstructor() {
    ChineseTextProducer cProd = new ChineseTextProducer();
    String ans = cProd.getText();
    assertEquals(ans.length(), DEFAULT_LENGTH);
    for (int i = 0; i < ans.length(); i++) {
      char c = ans.charAt(i);
      assertTrue("Character was'" + c + "' (" + (int) c + "), should be greater than " + CODE_POINT_START + " and less than " + CODE_POINT_END, 
          c >= CODE_POINT_START && c <= CODE_POINT_END);
    }
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.