package me.dvorkin;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class TestStringUtils {
String s;
@Before
public void setUp() {
s = "Night";
}
@Test
public void testRemoveVowels() {
assertEquals(StringUtils.removeVowels("hello"), "hll");
assertEquals(StringUtils.removeVowels("eeeuuu"), "");
assertEquals(StringUtils.removeVowels("HELLO"), "HLL");
}
@Test
public void testRemoveN() {
assertEquals(StringUtils.removeN("night"), "ight");
}
@Test
public void testSequentialUse() {
s = StringUtils.removeVowels(s);
assertEquals(s, "Nght");
s = StringUtils.removeN(s);
assertEquals(s, "ght");
}
@Test
public void testSequentialUse2() {
s = StringUtils.removeN(s);
assertEquals(s, "ight");
s = StringUtils.removeVowels(s);
assertEquals(s, "ght");
}
}
Comments