From f736217341f7c3233805b58e446493c57e09b4ec Mon Sep 17 00:00:00 2001 From: Ankush263 <86042508+Ankush263@users.noreply.github.com> Date: Thu, 12 May 2022 21:22:30 +0530 Subject: [PATCH] merge: Add test case to KeywordShiftedAlphabet algorithm (#1013) --- 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 000000000..7cc7c4820 --- /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) +})