Пример #1
0
 @Test
 public void testMinCat() {
   assertEquals("loHi", obj.minCat("Hello", "Hi"));
   assertEquals("ellojava", obj.minCat("Hello", "java"));
   assertEquals("javaello", obj.minCat("java", "Hello"));
 }
Пример #2
0
 @Test
 public void testRight2() {
   assertEquals("loHel", obj.right2("Hello"));
   assertEquals("vaja", obj.right2("java"));
   assertEquals("Hi", obj.right2("Hi"));
 }
Пример #3
0
 @Test
 public void testWithoutEnd2() {
   assertEquals("ell", obj.withoutEnd2("Hello"));
   assertEquals("b", obj.withoutEnd2("abc"));
   assertEquals("", obj.withoutEnd2("ab"));
 }
Пример #4
0
 @Test
 public void testWithoutEnd() {
   assertEquals("ell", obj.withoutEnd("Hello"));
   assertEquals("av", obj.withoutEnd("java"));
   assertEquals("odin", obj.withoutEnd("coding"));
 }
Пример #5
0
 @Test
 public void testNonStart() {
   assertEquals("ellohere", obj.nonStart("Hello", "There"));
   assertEquals("avaode", obj.nonStart("java", "code"));
   assertEquals("hotlava", obj.nonStart("shotl", "java"));
 }
Пример #6
0
 @Test
 public void testMakeOutWord() {
   assertEquals("<<Yay>>", obj.makeOutWord("<<>>", "Yay"));
   assertEquals("<<WooHoo>>", obj.makeOutWord("<<>>", "WooHoo"));
   assertEquals("[[word]]", obj.makeOutWord("[[]]", "word"));
 }
Пример #7
0
 @Test
 public void testFirstTwo() {
   assertEquals("He", obj.firstTwo("He"));
   assertEquals("ab", obj.firstTwo("abcdefg"));
   assertEquals("ab", obj.firstTwo("ab"));
 }
Пример #8
0
 @Test
 public void testHasBad() {
   assertTrue(obj.hasBad("badxx"));
   assertTrue(obj.hasBad("xbadxx"));
   assertFalse(obj.hasBad("xxbadxx"));
 }
Пример #9
0
 @Test
 public void testAtFirst() {
   assertEquals("he", obj.atFirst("hello"));
   assertEquals("hi", obj.atFirst("hi"));
   assertEquals("h@", obj.atFirst("h"));
 }
Пример #10
0
 @Test
 public void testTwoChar() {
   assertEquals("ja", obj.twoChar("java", 0));
   assertEquals("va", obj.twoChar("java", 2));
   assertEquals("ja", obj.twoChar("java", 3));
 }
Пример #11
0
 @Test
 public void testMiddleThree() {
   assertEquals("and", obj.middleThree("Candy"));
   assertEquals("and", obj.middleThree("and"));
   assertEquals("lvi", obj.middleThree("solving"));
 }
Пример #12
0
 @Test
 public void testNTwice() {
   assertEquals("Helo", obj.nTwice("Hello", 2));
   assertEquals("Choate", obj.nTwice("Chocolate", 3));
   assertEquals("Ce", obj.nTwice("Chocolate", 1));
 }
Пример #13
0
 @Test
 public void testEndsLy() {
   assertTrue(obj.endsLy("oddly"));
   assertFalse(obj.endsLy("y"));
   assertFalse(obj.endsLy("oddy"));
 }
Пример #14
0
 @Test
 public void testMiddleTwo() {
   assertEquals("ri", obj.middleTwo("string"));
   assertEquals("od", obj.middleTwo("code"));
   assertEquals("ct", obj.middleTwo("Practice"));
 }
Пример #15
0
 @Test
 public void testExtraFront() {
   assertEquals("HeHeHe", obj.extraFront("Hello"));
   assertEquals("ababab", obj.extraFront("ab"));
   assertEquals("HHH", obj.extraFront("H"));
 }
Пример #16
0
 @Test
 public void testLastChars() {
   assertEquals("ls", obj.lastChars("last", "chars"));
   assertEquals("ya", obj.lastChars("yo", "java"));
   assertEquals("h@", obj.lastChars("hi", ""));
 }
Пример #17
0
 @Test
 public void testMakeTags() {
   assertEquals("<i>Yay</i>", obj.makeTags("i", "Yay"));
   assertEquals("<i>Hello</i>", obj.makeTags("i", "Hello"));
   assertEquals("<cite>Yay</cite>", obj.makeTags("cite", "Yay"));
 }
Пример #18
0
 @Test
 public void testConCat() {
   assertEquals("abcat", obj.conCat("abc", "cat"));
   assertEquals("dogcat", obj.conCat("dog", "cat"));
   assertEquals("abc", obj.conCat("abc", ""));
 }
Пример #19
0
 @Test
 public void testExtraEnd() {
   assertEquals("lololo", obj.extraEnd("Hello"));
   assertEquals("ababab", obj.extraEnd("ab"));
   assertEquals("HiHiHi", obj.extraEnd("Hi"));
 }
Пример #20
0
 @Test
 public void testMakeAbba() {
   assertEquals("HiByeByeHi", obj.makeAbba("Hi", "Bye"));
   assertEquals("YoAliceAliceYo", obj.makeAbba("Yo", "Alice"));
   assertEquals("WhatUpUpWhat", obj.makeAbba("What", "Up"));
 }
Пример #21
0
 @Test
 public void testFirstHalf() {
   assertEquals("Woo", obj.firstHalf("WooHoo"));
   assertEquals("Hello", obj.firstHalf("HelloThere"));
   assertEquals("abc", obj.firstHalf("abcdef"));
 }
Пример #22
0
 @Test
 public void testLastTwo() {
   assertEquals("codign", obj.lastTwo("coding"));
   assertEquals("cta", obj.lastTwo("cat"));
   assertEquals("ba", obj.lastTwo("ab"));
 }
Пример #23
0
 @Test
 public void testComboString() {
   assertEquals("hiHellohi", obj.comboString("Hello", "hi"));
   assertEquals("hiHellohi", obj.comboString("hi", "Hello"));
   assertEquals("baaab", obj.comboString("aaa", "b"));
 }
Пример #24
0
 @Test
 public void testSeeColor() {
   assertEquals("red", obj.seeColor("redxx"));
   assertEquals("", obj.seeColor("xxred"));
   assertEquals("blue", obj.seeColor("blueTimes"));
 }
Пример #25
0
 @Test
 public void testLeft2() {
   assertEquals("lloHe", obj.left2("Hello"));
   assertEquals("vaja", obj.left2("java"));
   assertEquals("Hi", obj.left2("Hi"));
 }
Пример #26
0
 @Test
 public void testFrontAgain() {
   assertTrue(obj.frontAgain("edited"));
   assertFalse(obj.frontAgain("edit"));
   assertTrue(obj.frontAgain("ed"));
 }
Пример #27
0
 @Test
 public void testTheEnd() {
   assertEquals("H", obj.theEnd("Hello", true));
   assertEquals("o", obj.theEnd("Hello", false));
   assertEquals("o", obj.theEnd("oh", true));
 }
Пример #28
0
 @Test
 public void testHelloName() {
   assertEquals("Hello Bob!", obj.helloName("Bob"));
   assertEquals("Hello Alice!", obj.helloName("Alice"));
   assertEquals("Hello X!", obj.helloName("X"));
 }