Package no.priv.garshol.duke.test

Source Code of no.priv.garshol.duke.test.TrimCleanerTest

package no.priv.garshol.duke.test;

import org.junit.Test;
import org.junit.Before;
import static junit.framework.Assert.assertEquals;

import no.priv.garshol.duke.cleaners.TrimCleaner;

public class TrimCleanerTest {
  private TrimCleaner cleaner;

  @Before
  public void setup() {
    cleaner = new TrimCleaner();
  }
 
  @Test
  public void testEmpty() {
    test("", null);
  }
 
  @Test
  public void testOnlyDigits() {
    test("314", "314");
  }
 
  @Test
  public void testDigitsAndSpaces() {
    test(" 3 1 4 ", "3 1 4");
  }
 
  private void test(String value, String result) {
    assertEquals(result, cleaner.clean(value));
  }
}
TOP

Related Classes of no.priv.garshol.duke.test.TrimCleanerTest

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.