Updated tests

This commit is contained in:
2022-02-22 18:40:38 +00:00
parent 3ccdd6b72d
commit c7459e6518

View File

@@ -1,7 +1,7 @@
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/monoSubstitution/Vigenere.java //CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/monoSubstitution/Vigenere.java
//Matthew Ellison //Matthew Ellison
// Created: 07-25-21 // Created: 07-25-21
//Modified: 02-17-22 //Modified: 02-22-22
package com.mattrixwv.CipherStreamJava.monoSubstitution; package com.mattrixwv.CipherStreamJava.monoSubstitution;
@@ -38,7 +38,7 @@ public class Vigenere{
} }
if(!preserveCapitals){ if(!preserveCapitals){
inputString = inputString.toLowerCase(); inputString = inputString.toUpperCase();
} }
if(!preserveWhitespace){ if(!preserveWhitespace){
inputString = inputString.replaceAll("\\s", ""); inputString = inputString.replaceAll("\\s", "");
@@ -175,17 +175,17 @@ public class Vigenere{
return offset; return offset;
} }
//Encodes input using key and returns the result //Encodes input using key and returns the result
public String encode(String key, String input) throws InvalidKeywordException, InvalidInputException{ public String encode(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
reset(); reset();
setKeyword(key); setKeyword(keyword);
setInputString(input); setInputString(inputString);
return encode(); return encode();
} }
//Decodes input using key and returns the result //Decodes input using key and returns the result
public String decode(String key, String input) throws InvalidKeywordException, InvalidInputException{ public String decode(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
reset(); reset();
setKeyword(key); setKeyword(keyword);
setInputString(input); setInputString(inputString);
return decode(); return decode();
} }
//Makes sure all of the variables are empty //Makes sure all of the variables are empty