forked from JabRef/jabref
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Add test for the StringChangeNextWord class
Thois commit adds a start for tests for the StringChangeNextWord class. [issue: #9]
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/test/java/org/jabref/logic/util/strings/StringChangeNextWordTest.java
This file contains 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
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); | ||
} | ||
} |