Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update StringSimilarityTest.java #13

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ public void setup() {
}

@Test
public void givenIdenticalStrings_whenIsSimilarMethod_thenReturnTrue() {
public void givenIdenticalStrings_whenTestingForSimilarity_thenJudgeThatAreSimilar() {
String a = "Hello";
String b = "Hello";
assertTrue(sut.isSimilar(a, b));
}

@Test
public void givenIdenticalStrings_whenEditDistanceIgnoreCaseMethod_thenReturnZero() {
public void givenIdenticalStrings_whenFindingAmountOfCharChangesNeededToMakeStringsIdentical_thenLevenshteinDistance() {
String a = "A";
String b = "A";
assertEquals(0.0, sut.editDistanceIgnoreCase(a, b));
}

@Test
public void givenSlightlyDifferentStrings_whenEditDistanceIgnoreCaseMethod_thenReturnLevenshteinDistance() {
public void givenSlightlyDifferentStrings_whenFindingAmountOfCharChangesNeededToMakeStringsIdentical_thenReturnCorrectLevenshteinDistance() {
String a = "Abc";
String b = "Bbc";
assertEquals(1.0, sut.editDistanceIgnoreCase(a,b));
}

@Test
public void givenVeryDifferentStrings_whenEditDistanceIgnoreCaseMethod_thenReturnLevenshteinDistance() {
public void givenVeryDifferentStrings_whenFindingAmountOfCharChangesNeededToMakeStringsIdentical_thenReturnCorrectLevenshteinDistance() {
String a = "Fish";
String b = "Bears";
assertEquals(5.0, sut.editDistanceIgnoreCase(a,b));
}

@Test
public void givenDissimilarStrings_whenIsSimilarMethod_thenReturnFalse() {
public void givenVeryDifferentStrings_whenTestingForSimilarity_thenJudgeThemToBeDissimilar() {
String a = "Johnson";
String b = "Daghtsen";
System.out.println(sut.editDistanceIgnoreCase(a,b));
Expand Down