Advertisement
mikhail_dvorkin

Untitled

Feb 18th, 2017
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. package me.dvorkin;
  2.  
  3. import static org.junit.Assert.*;
  4.  
  5. import org.junit.Before;
  6. import org.junit.Test;
  7.  
  8. public class TestStringUtils {
  9.     String s;
  10.    
  11.     @Before
  12.     public void setUp() {
  13.         s = "Night";
  14.     }
  15.  
  16.     @Test
  17.     public void testRemoveVowels() {
  18.         assertEquals(StringUtils.removeVowels("hello"), "hll");
  19.         assertEquals(StringUtils.removeVowels("eeeuuu"), "");
  20.         assertEquals(StringUtils.removeVowels("HELLO"), "HLL");
  21.     }
  22.  
  23.     @Test
  24.     public void testRemoveN() {
  25.         assertEquals(StringUtils.removeN("night"), "ight");
  26.     }
  27.    
  28.     @Test
  29.     public void testSequentialUse() {
  30.         s = StringUtils.removeVowels(s);
  31.         assertEquals(s, "Nght");
  32.         s = StringUtils.removeN(s);
  33.         assertEquals(s, "ght");
  34.     }
  35.  
  36.     @Test
  37.     public void testSequentialUse2() {
  38.         s = StringUtils.removeN(s);
  39.         assertEquals(s, "ight");
  40.         s = StringUtils.removeVowels(s);
  41.         assertEquals(s, "ght");
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement