Created
March 2, 2017 11:59
-
-
Save gokhanaliccii/049d9774ed68d3fc678a6eb74830a148 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
public class TestClass { | |
//gradle junit le ilgili hata olustugundan burda yazdım testleri | |
public static void main(String args[]) { | |
TestClass testClass = new TestClass(); | |
testClass.test3(); | |
} | |
private void test1() { | |
String input = "aaba kouq bux"; | |
int limit = 2; | |
test(input, " koq x", limit); | |
} | |
private void test2() { | |
String input = "aaba kouq bux"; | |
int limit = 3; | |
test(input, "b kouq bux", limit); | |
} | |
private void test3() { | |
String input = "aaba kouq bux"; | |
int limit = 4; | |
test(input, "aaba kouq bux", limit); | |
} | |
private void test(String input, String expected, int limit) { | |
CharacterRemover remover = new CharacterRemover(); | |
input = remover.removeExtraCharacters(input, limit); | |
System.out.println("Input:" + input + " limit:" + limit); | |
System.out.print("Result is: " + input + " Expected Text:" + expected); | |
System.out.print("Test result is:" + input.equals(expected)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment