From 98acf4ad1e5574305a04043f6b64f7bd1cde61c2 Mon Sep 17 00:00:00 2001 From: Ankush263 Date: Tue, 17 May 2022 16:45:57 +0530 Subject: [PATCH] Add test case to Vigenere Cipher Algorithm --- Ciphers/test/VigenereCipher.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Ciphers/test/VigenereCipher.test.js diff --git a/Ciphers/test/VigenereCipher.test.js b/Ciphers/test/VigenereCipher.test.js new file mode 100644 index 0000000000..de8618b8cd --- /dev/null +++ b/Ciphers/test/VigenereCipher.test.js @@ -0,0 +1,13 @@ +import { encrypt, decrypt } from '../VigenereCipher' + +test('Hello world! === dcrypt(encrypt(Hello world!))', () => { + const word = 'Hello world!' + const result = decrypt(encrypt(word, 'code'), 'code') + expect(result).toMatch(word) +}) + +test('The Algorithms === dcrypt(encrypt(The Algorithms))', () => { + const word = 'The Algorithms' + const result = decrypt(encrypt(word, 'code'), 'code') + expect(result).toMatch(word) +})