Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement