Update error messages and test names

This commit is contained in:
Mattrixwv
2024-04-19 22:36:52 -04:00
parent 434260969c
commit 0b1d5a3d91
46 changed files with 395 additions and 520 deletions

View File

@@ -1,7 +1,7 @@
//CipherStreamJava/src/test/java/com/mattrixwv/CipherStreamJava/Baconian.java
//Mattrixwv
// Created: 01-12-22
//Modified: 05-04-23
//Modified: 04-19-24
package com.mattrixwv.cipherstream.monosubstitution;
@@ -76,14 +76,14 @@ public class Baconian{
//Make sure each letter contains 5 characters
if(str.length() != 5){
throw new InvalidCharacterException("All Baconian letters contain exactly 5 characters: " + str);
throw new InvalidCharacterException("All Baconian 'letters' contain exactly 5 characters. Invalid 'letter': " + str);
}
//Make sure the letter contains only a's and b's
logger.debug("Replacing all non-abAB characters");
String temp = str.replaceAll("[^abAB]", "");
if(!temp.equals(str)){
throw new InvalidCharacterException("Baconian letters contain only a's and b's: " + str);
throw new InvalidCharacterException("Baconian 'letters' contain only a's and b's. Invalid 'letter': " + str);
}
}