Updated tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/monoSubstitution/Vigenere.java
|
||||
//Matthew Ellison
|
||||
// Created: 07-25-21
|
||||
//Modified: 02-17-22
|
||||
//Modified: 02-22-22
|
||||
package com.mattrixwv.CipherStreamJava.monoSubstitution;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Vigenere{
|
||||
}
|
||||
|
||||
if(!preserveCapitals){
|
||||
inputString = inputString.toLowerCase();
|
||||
inputString = inputString.toUpperCase();
|
||||
}
|
||||
if(!preserveWhitespace){
|
||||
inputString = inputString.replaceAll("\\s", "");
|
||||
@@ -175,17 +175,17 @@ public class Vigenere{
|
||||
return offset;
|
||||
}
|
||||
//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();
|
||||
setKeyword(key);
|
||||
setInputString(input);
|
||||
setKeyword(keyword);
|
||||
setInputString(inputString);
|
||||
return encode();
|
||||
}
|
||||
//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();
|
||||
setKeyword(key);
|
||||
setInputString(input);
|
||||
setKeyword(keyword);
|
||||
setInputString(inputString);
|
||||
return decode();
|
||||
}
|
||||
//Makes sure all of the variables are empty
|
||||
|
||||
Reference in New Issue
Block a user