Added Columnar
This commit is contained in:
@@ -5,16 +5,472 @@
|
||||
package com.mattrixwv.CipherStreamJava.polySubstitution;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import com.mattrixwv.CipherStreamJava.exceptions.InvalidCharacterException;
|
||||
import com.mattrixwv.CipherStreamJava.exceptions.InvalidInputException;
|
||||
import com.mattrixwv.CipherStreamJava.exceptions.InvalidKeywordException;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
public class TestColumnar{
|
||||
@Test
|
||||
public void testEncode(){
|
||||
Columnar cipher = new Columnar(true, true, true);
|
||||
public void testEncode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(true, true, true, false);
|
||||
|
||||
//Test lowercase encoding
|
||||
String inputString = "messagetoencode";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "edxeoxmteacxgoxsnxsex";
|
||||
String output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed lowercase encoding.", correctOutput, output);
|
||||
//Test uppercase encoding
|
||||
inputString = "MESSAGETOENCODE";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXMTEACXGOXsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed uppercase encoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace encoding
|
||||
inputString = "message to encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "edxeoxm te acxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed whitespace encoding.", correctOutput, output);
|
||||
|
||||
//Test symbol encoding
|
||||
inputString = "message@to-encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "edxeoxm@te-acxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed symbol encoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol encoding
|
||||
inputString = "Message to*encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "Edxeoxm te*acxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed whitespace encoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testDecode(){
|
||||
Columnar cipher = new Columnar(true, true, true);
|
||||
public void testNoCapitalEncode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(false, true, true, false);
|
||||
|
||||
//Test lowercase encoding
|
||||
String inputString = "messagetoencode";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "EDXEOXMTEACXGOXSNXSEX";
|
||||
String output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capitals lowercase encoding.", correctOutput, output);
|
||||
//Test uppercase encoding
|
||||
inputString = "MESSAGETOENCODE";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXMTEACXGOXSNXSEX";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capitals uppercase encoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace encoding
|
||||
inputString = "message to encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXM TE ACXGOXSNXSEX";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capitals whitespace encoding.", correctOutput, output);
|
||||
|
||||
//Test symbol encoding
|
||||
inputString = "message@to-encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXM@TE-ACXGOXSNXSEX";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capitals symbol encoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol encoding
|
||||
inputString = "Message to*encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXM TE*ACXGOXSNXSEX";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capitals whitespace encoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoWhitespaceEncode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(true, false, true, false);
|
||||
|
||||
//Test lowercase encoding
|
||||
String inputString = "messagetoencode";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "edxeoxmteacxgoxsnxsex";
|
||||
String output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace lowercase encoding.", correctOutput, output);
|
||||
//Test uppercase encoding
|
||||
inputString = "MESSAGETOENCODE";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXMTEACXGOXsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace uppercase encoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace encoding
|
||||
inputString = "message to encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "edxeoxmteacxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace whitespace encoding.", correctOutput, output);
|
||||
|
||||
//Test symbol encoding
|
||||
inputString = "message@to-encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "edxeoxm@te-acxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace symbol encoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol encoding
|
||||
inputString = "Message to*encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "Edxeoxmte*acxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace whitespace encoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoSymbolEncode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(true, true, false, false);
|
||||
|
||||
//Test lowercase encoding
|
||||
String inputString = "messagetoencode";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "edxeoxmteacxgoxsnxsex";
|
||||
String output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol lowercase encoding.", correctOutput, output);
|
||||
//Test uppercase encoding
|
||||
inputString = "MESSAGETOENCODE";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXMTEACXGOXsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol uppercase encoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace encoding
|
||||
inputString = "message to encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "edxeoxm te acxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol whitespace encoding.", correctOutput, output);
|
||||
|
||||
//Test symbol encoding
|
||||
inputString = "message@to-encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "edxeoxmteacxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol symbol encoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol encoding
|
||||
inputString = "Message to*encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "Edxeoxm teacxgoxsnxsex";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol whitespace encoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoPaddingEncoding() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(true, true, true, true);
|
||||
|
||||
//Test lowercase encoding
|
||||
String inputString = "messagetoencode";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "edeomteacgosnse";
|
||||
String output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding lowercase encoding.", correctOutput, output);
|
||||
//Test uppercase encoding
|
||||
inputString = "MESSAGETOENCODE";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDEOMTEACGOSNSE";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding uppercase encoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace encoding
|
||||
inputString = "message to encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "edeomte ac gosnse";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding whitespace encoding.", correctOutput, output);
|
||||
|
||||
//Test symbol encoding
|
||||
inputString = "message@to-encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "edeomte@ac-gosnse";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding symbol encoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol encoding
|
||||
inputString = "Message To*encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "Edeomte Ac*gosnse";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding whitespace encoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoCapitalWhitespaceSymbolEncode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(false, false, false, false);
|
||||
|
||||
//Test lowercase encoding
|
||||
String inputString = "messagetoencode";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "EDXEOXMTEACXGOXSNXSEX";
|
||||
String output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure lowercase encoding.", correctOutput, output);
|
||||
//Test uppercase encoding
|
||||
inputString = "MESSAGETOENCODE";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXMTEACXGOXSNXSEX";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure uppercase encoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace encoding
|
||||
inputString = "message to encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXMTEACXGOXSNXSEX";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure whitespace encoding.", correctOutput, output);
|
||||
|
||||
//Test symbol encoding
|
||||
inputString = "message@to-encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXMTEACXGOXSNXSEX";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure symbol encoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol encoding
|
||||
inputString = "Message to*encode";
|
||||
keyword = "keyword";
|
||||
correctOutput = "EDXEOXMTEACXGOXSNXSEX";
|
||||
output = cipher.encode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure whitespace encoding.", correctOutput, output);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testDecode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(true, true, true, false);
|
||||
|
||||
//Test lowercase decoding
|
||||
String inputString = "edxeoxmteacxgoxsnxsex";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "messagetoencodexxxxxx";
|
||||
String output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed lowercase decoding.", correctOutput, output);
|
||||
//Test uppercase decoding
|
||||
inputString = "EDXEOXMTEACXGOXsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODExxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed uppercase decoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace decoding
|
||||
inputString = "edxeoxm te acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "message to encodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed whitespace decoding.", correctOutput, output);
|
||||
|
||||
//Test symbol decoding
|
||||
inputString = "edxeoxm@te-acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "message@to-encodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed symbol decoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol decoding
|
||||
inputString = "Edxeoxm te*acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "Message to*encodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed whitespace decoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoCapitalDecode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(false, true, true, false);
|
||||
|
||||
//Test lowercase decoding
|
||||
String inputString = "edxeoxmteacxgoxsnxsex";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "MESSAGETOENCODEXXXXXX";
|
||||
String output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capital lowercase decoding.", correctOutput, output);
|
||||
//Test uppercase decoding
|
||||
inputString = "EDXEOXMTEACXGOXsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODEXXXXXX";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capital uppercase decoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace decoding
|
||||
inputString = "edxeoxm te acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGE TO ENCODEXXXXXX";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capital whitespace decoding.", correctOutput, output);
|
||||
|
||||
//Test symbol decoding
|
||||
inputString = "edxeoxm@te-acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGE@TO-ENCODEXXXXXX";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capital symbol decoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol decoding
|
||||
inputString = "Edxeoxm te*acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGE TO*ENCODEXXXXXX";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no capital whitespace decoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoWhitespaceDecode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(true, false, true, false);
|
||||
|
||||
//Test lowercase decoding
|
||||
String inputString = "edxeoxmteacxgoxsnxsex";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "messagetoencodexxxxxx";
|
||||
String output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace lowercase decoding.", correctOutput, output);
|
||||
//Test uppercase decoding
|
||||
inputString = "EDXEOXMTEACXGOXsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODExxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace uppercase decoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace decoding
|
||||
inputString = "edxeoxm te acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "messagetoencodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace whitespace decoding.", correctOutput, output);
|
||||
|
||||
//Test symbol decoding
|
||||
inputString = "edxeoxm@te-acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "message@to-encodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace symbol decoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol decoding
|
||||
inputString = "Edxeoxm te*acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "Messageto*encodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no whitespace whitespace decoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoSymbolDecode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(true, true, false, false);
|
||||
|
||||
//Test lowercase decoding
|
||||
String inputString = "edxeoxmteacxgoxsnxsex";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "messagetoencodexxxxxx";
|
||||
String output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol lowercase decoding.", correctOutput, output);
|
||||
//Test uppercase decoding
|
||||
inputString = "EDXEOXMTEACXGOXsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODExxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol uppercase decoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace decoding
|
||||
inputString = "edxeoxm te acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "message to encodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol whitespace decoding.", correctOutput, output);
|
||||
|
||||
//Test symbol decoding
|
||||
inputString = "edxeoxm@te-acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "messagetoencodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol symbol decoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol decoding
|
||||
inputString = "Edxeoxm te*acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "Message toencodexxxxxx";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no symbol whitespace decoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoPaddingDecoding() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(true, true, true, true);
|
||||
|
||||
//Test lowercase decoding
|
||||
String inputString = "edeomteacgosnse";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "messagetoencode";
|
||||
String output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding lowercase decoding.", correctOutput, output);
|
||||
//Test uppercase decoding
|
||||
inputString = "EDEOMTEACGOSNSE";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODE";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding uppercase decoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace decoding
|
||||
inputString = "edeomte ac gosnse";
|
||||
keyword = "keyword";
|
||||
correctOutput = "message to encode";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding whitespace decoding.", correctOutput, output);
|
||||
|
||||
//Test symbol decoding
|
||||
inputString = "edeomte@ac-gosnse";
|
||||
keyword = "keyword";
|
||||
correctOutput = "message@to-encode";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding symbol decoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol decoding
|
||||
inputString = "Edeomte ac*gosnse";
|
||||
keyword = "keyword";
|
||||
correctOutput = "Message to*encode";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed no padding whitespace decoding.", correctOutput, output);
|
||||
}
|
||||
@Test
|
||||
public void testNoCapitalWhitespaceSymbolDecode() throws InvalidCharacterException, InvalidKeywordException, InvalidInputException{
|
||||
Columnar cipher = new Columnar(false, false, false, false);
|
||||
|
||||
//Test lowercase decoding
|
||||
String inputString = "edxeoxmteacxgoxsnxsex";
|
||||
String keyword = "keyword";
|
||||
String correctOutput = "MESSAGETOENCODEXXXXXX";
|
||||
String output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure lowercase decoding.", correctOutput, output);
|
||||
//Test uppercase decoding
|
||||
inputString = "EDXEOXMTEACXGOXsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODEXXXXXX";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure uppercase decoding.", correctOutput, output);
|
||||
|
||||
//Test whitespace decoding
|
||||
inputString = "edxeoxm te acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODEXXXXXX";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure whitespace decoding.", correctOutput, output);
|
||||
|
||||
//Test symbol decoding
|
||||
inputString = "edxeoxm@te-acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODEXXXXXX";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure symbol decoding.", correctOutput, output);
|
||||
|
||||
//Test mixed case, whitespace, symbol decoding
|
||||
inputString = "Edxeoxm te*acxgoxsnxsex";
|
||||
keyword = "keyword";
|
||||
correctOutput = "MESSAGETOENCODEXXXXXX";
|
||||
output = cipher.decode(keyword, inputString);
|
||||
assertEquals("Columnar failed secure whitespace decoding.", correctOutput, output);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user