Package is.us.formatters

Source Code of is.us.formatters.TestUSPersidnoFormatter

package is.us.formatters;

import static org.junit.Assert.assertEquals;
import is.us.formatters.USPersidnoFormatter;

import java.text.ParseException;

import org.junit.Test;

/**
* Tests for USPersidnoFormatter.
*
* @author Hugi Thordarson
*/

public class TestUSPersidnoFormatter {

  @Test
  public void parsing() throws ParseException {
    String input = "091179-4829";
    String expected = "0911794829";

    USPersidnoFormatter formatter = new USPersidnoFormatter();
    assertEquals( formatter.parseObject( input ), expected );
  }

  @Test
  public void formatting() {
    String input = "0911794829";
    String expected = "091179-4829";

    USPersidnoFormatter formatter = new USPersidnoFormatter();
    assertEquals( formatter.format( input ), expected );
    assertEquals( formatter.format( null ), "" );
  }
}
TOP

Related Classes of is.us.formatters.TestUSPersidnoFormatter

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.