WhitespaceIntegrityChecker extends AbstractTextUnitIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws WhitespaceIntegrityCheckerException { checkLeadingWhitespaces(sourceContent, targetContent); checkTrailingWhitespaces(sourceContent, targetContent); }  @Override void check(String sourceContent, String targetContent); void checkLeadingWhitespaces(String sourceContent, String targetContent); void checkTrailingWhitespaces(String sourceContent, String targetContent);  }
@Test public void testWhitespaceIntegrityCheckerWorksWithNoLeadingTrailingWhitespaces() { String source = "There are %1 files and %2 folders"; String target = "Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test public void testWhitespaceIntegrityCheckerWorksWithLeadingTrailingWhitespaces() { String source = " There are %1 files and %2 folders\n"; String target = " Il y a %1 fichiers et %2 dossiers\n"; checker.check(source, target); }
@Test public void testWhitespaceIntegrityCheckerWorksWithMultipleLeadingTrailingWhitespaces() { String source = "\t There are %1 files and %2 folders \n"; String target = "\t Il y a %1 fichiers et %2 dossiers \n"; checker.check(source, target); }
@Test(expected = WhitespaceIntegrityCheckerException.class) public void testWhitespaceIntegrityCheckerWorksWithDifferentLeadingTrailingWhitespaces1() { String source = " There are %1 files and %2 folders \n"; String target = " Il y a %1 fichiers et %2 dossiers\n"; checker.check(source, target); }
@Test(expected = WhitespaceIntegrityCheckerException.class) public void testWhitespaceIntegrityCheckerWorksWithDifferentLeadingTrailingWhitespaces2() { String source = "\nThere are %1 files and %2 folders "; String target = " Il y a %1 fichiers et %2 dossiers\n"; checker.check(source, target); }
@Test public void testLeadingWhitespaceCheckWorks() { String source = "\n There are %1 files and %2 folders"; String target = "\n Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test public void testLeadingWhitespaceCheckWorksWithoutLeadingWhitespaces() { String source = "There are %1 files and %2 folders"; String target = "Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test(expected = WhitespaceIntegrityCheckerException.class) public void testLeadingWhitespaceCheckCatchesRemovedNewline() { String source = "\nThere are %1 files and %2 folders"; String target = "Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test(expected = WhitespaceIntegrityCheckerException.class) public void testLeadingWhitespaceCheckCatchesRemovedSpace() { String source = " There are %1 files and %2 folders"; String target = "Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test(expected = WhitespaceIntegrityCheckerException.class) public void testLeadingWhitespaceCheckCatchesDifferentLeadingWhitespaces() { String source = " \nThere are %1 files and %2 folders"; String target = "\n Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test public void testTrailingWhitespaceCheckWorks() { String source = "There are %1 files and %2 folders \n"; String target = "Il y a %1 fichiers et %2 dossiers \n"; checker.check(source, target); }
@Test public void testTrailingWhitespaceCheckWorksWithoutTrailingWhitespaces() { String source = "There are %1 files and %2 folders"; String target = "Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test(expected = WhitespaceIntegrityCheckerException.class) public void testTrailingWhitespaceCheckCatchesRemovedNewline() { String source = "There are %1 files and %2 folders\n"; String target = "Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test(expected = WhitespaceIntegrityCheckerException.class) public void testTrailingWhitespaceCheckCatchesRemovedSpace() { String source = "There are %1 files and %2 folders "; String target = "Il y a %1 fichiers et %2 dossiers"; checker.check(source, target); }
@Test(expected = WhitespaceIntegrityCheckerException.class) public void testTrailingWhitespaceCheckCatchesDifferentTrailingWhitespaces() { String source = "There are %1 files and %2 folders \n"; String target = "Il y a %1 fichiers et %2 dossiers\n "; checker.check(source, target); }