Skip to content

Commit

Permalink
(#907) New ctors for LowerText and UpperText
Browse files Browse the repository at this point in the history
  • Loading branch information
llorllale committed Jun 8, 2018
1 parent c6ca6d1 commit d13c9cc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/org/cactoos/text/LowerText.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
*/
public final class LowerText extends TextEnvelope {

/**
* Ctor.
* @param text The text
*/
public LowerText(final String text) {
this(new TextOf(text));
}

/**
* Ctor.
* @param text The text
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/cactoos/text/UpperText.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public final class UpperText implements Text {
*/
private final Locale locale;

/**
* Ctor.
* @param text The text
*/
public UpperText(final String text) {
this(new TextOf(text));
}

/**
* Ctor.
* @param text The text
Expand Down
8 changes: 8 additions & 0 deletions src/test/java/org/cactoos/text/LowerTextTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,12 @@ public void convertsText() {
);
}

@Test
public void convertsString() {
MatcherAssert.assertThat(
"Can't lower case a string",
new LowerText("WoRLd!"),
new TextHasString("world!")
);
}
}
8 changes: 8 additions & 0 deletions src/test/java/org/cactoos/text/UpperTextTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,12 @@ public void convertsText() {
);
}

@Test
public void convertsString() {
MatcherAssert.assertThat(
"Can't upper case a string",
new UpperText("World!"),
new TextHasString("WORLD!")
);
}
}

0 comments on commit d13c9cc

Please sign in to comment.