From ce9f7b1fe70cccf28733715598a90200be45d701 Mon Sep 17 00:00:00 2001 From: Ankush263 Date: Thu, 12 May 2022 20:04:29 +0530 Subject: [PATCH] Add test case to KeywordShiftedAlphabet algorithm --- Ciphers/test/KeywordShiftedAlphabet.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Ciphers/test/KeywordShiftedAlphabet.test.js diff --git a/Ciphers/test/KeywordShiftedAlphabet.test.js b/Ciphers/test/KeywordShiftedAlphabet.test.js new file mode 100644 index 0000000000..7cc7c4820b --- /dev/null +++ b/Ciphers/test/KeywordShiftedAlphabet.test.js @@ -0,0 +1,13 @@ +import { encrypt, decrypt } from '../KeywordShiftedAlphabet' + +test('Hello world! === dcrypt(encrypt(Hello world!))', () => { + const word = 'Hello world!' + const result = decrypt('keyword', encrypt('keyword', word)) + expect(result).toMatch(word) +}) + +test('The Algorithms === dcrypt(encrypt(The Algorithms))', () => { + const word = 'The Algorithms' + const result = decrypt('keyword', encrypt('keyword', word)) + expect(result).toMatch(word) +})