mikhail_dvorkin icon

Untitled

mikhail_dvorkin | PRO | 02/18/17 10:07:36 AM UTC | 0 ⭐ | 808 👁️ | Never ⏰ | []
Java |

860 B

|

None

|

0 👍

/

0 👎

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