Skip to content

Instantly share code, notes, and snippets.

@gokhanaliccii
Created March 2, 2017 11:59
Show Gist options
  • Save gokhanaliccii/049d9774ed68d3fc678a6eb74830a148 to your computer and use it in GitHub Desktop.
Save gokhanaliccii/049d9774ed68d3fc678a6eb74830a148 to your computer and use it in GitHub Desktop.
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