Advertisement
mikhail_dvorkin

TestStringUtils

Feb 27th, 2017
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 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 = "Hello, Denis!";
  14.     }
  15.    
  16.     @Test
  17.     public void testRemoveVowels() {
  18.         assertEquals(StringUtils.removeVowels("hello"), "hll");
  19.         assertEquals(StringUtils.removeVowels("HELLO"), "HLL");
  20.     }
  21.    
  22.     @Test
  23.     public void testSequential() {
  24.         s = StringUtils.removeVowels(s);
  25.         assertEquals(s, "Hll, Dns!");
  26.         s = StringUtils.removeN(s);
  27.         assertEquals(s, "Hll, Ds!");
  28.     }
  29.    
  30.     @Test
  31.     public void testSequential2() {
  32.         s = StringUtils.removeN(s);
  33.         assertEquals(s, "Hello, Deis!");
  34.         s = StringUtils.removeVowels(s);
  35.         assertEquals(s, "Hll, Ds!");
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement