-
-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pangram: add starter implementation and make object-based (#344)
Pangrams is currently the third exercise in the new ordering therefore it should have a starter implementation. * make object-orientated * add starter implementation * rename class to PangramChecker
- Loading branch information
1 parent
9f8244f
commit 99f4a1d
Showing
5 changed files
with
93 additions
and
78 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
...es/pangram/src/example/java/Pangrams.java → ...gram/src/example/java/PangramChecker.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
Empty file.
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,6 @@ | ||
public class PangramChecker { | ||
|
||
public boolean isPangram(String input) { | ||
throw new UnsupportedOperationException("Method has not been implemented yet."); | ||
} | ||
} |
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,82 @@ | ||
import org.junit.Before; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
public class PangramCheckerTest { | ||
private PangramChecker pangramChecker; | ||
|
||
@Before | ||
public void setup() { | ||
pangramChecker = new PangramChecker(); | ||
} | ||
|
||
|
||
@Test | ||
public void emptySentenceIsNotPangram() { | ||
assertFalse(pangramChecker.isPangram("")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void pangramWithOnlyLowerCaseLettersIsRecognizedAsPangram() { | ||
assertTrue(pangramChecker.isPangram("the quick brown fox jumps over the lazy dog")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void phraseMissingCharacterXIsNotPangram() { | ||
assertFalse(pangramChecker.isPangram("a quick movement of the enemy will jeopardize five gunboats")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void anotherPhraseMissingCharacterXIsNotPangram() { | ||
assertFalse(pangramChecker.isPangram("the quick brown fish jumps over the lazy dog")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void pangramWithUnderscoresIsRecognizedAsPangram() { | ||
assertTrue(pangramChecker.isPangram("\"the_quick_brown_fox_jumps_over_the_lazy_dog\"")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void pangramWithNumbersIsRecognizedAsPangram() { | ||
assertTrue(pangramChecker.isPangram("\"the 1 quick brown fox jumps over the 2 lazy dogs\"")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void phraseWithMissingLettersReplacedByNumbersIsNotPangram() { | ||
assertFalse(pangramChecker.isPangram("\"7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog\"")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void pangramWithMixedCaseAndPunctuationIsRecognizedAsPangram() { | ||
assertTrue(pangramChecker.isPangram("\"Five quacking Zephyrs jolt my wax bed.\"")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void pangramWithNonAsciiCharactersIsRecognizedAsPangram() { | ||
assertTrue(pangramChecker.isPangram("Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.")); | ||
} | ||
|
||
|
||
@Ignore | ||
@Test | ||
public void panagramInAlphabetOtherThanAsciiIsNotRecognizedAsPangram() { | ||
assertFalse(pangramChecker.isPangram("Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства.")); | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void upperAndLowerCaseVersionsOfTheSameCharacterShouldNotBeCountedSeparately() { | ||
assertFalse(pangramChecker.isPangram("the quick brown fox jumped over the lazy FOX")); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.