Skip to content

Commit

Permalink
[feat] Add test for the StringChangeNextWord class
Browse files Browse the repository at this point in the history
Thois commit adds a start for tests for the StringChangeNextWord class.

[issue: #9]
  • Loading branch information
Zodbigt committed Feb 27, 2020
1 parent 8e30567 commit b11ccb8
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.jabref.logic.util.strings;

import org.jabref.logic.util.strings.StringChangeNextWord;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class StringChangeNextWordTest {

@Test
public void editNextWordCapitalizePreservesNewlines() {
int pos = 3;
String textInput = "hello\nhello";
String whatTextShouldBe = "hello\nHello";
String textOutput = new StringChangeNextWord().editNextWordCapitalize(pos, textInput);
assertEquals(textOutput, whatTextShouldBe);
}

@Test
public void editNextWordUpperCaseEditsTheNextWord() {
int pos = 3;
String textInput = "hello hello";
String whatTextShouldBe = "hello HELLO";
String textOutput = new StringChangeNextWord().editNextWordUpperCase(pos, textInput);
assertEquals(textOutput, whatTextShouldBe);
}
}

0 comments on commit b11ccb8

Please sign in to comment.