Example #1
0
        public void EncryptTest()
        {
            string msg      = "Hello World?";
            Cipher cipher   = new Vernam_Cipher(msg);
            string expected = cipher.Encrypt();

            Assert.IsNotNull(expected);
            Assert.AreNotEqual(expected, msg);
        }
Example #2
0
        public void Vernam_CipherTest()
        {
            string msg    = "Hello world I am the ultimate cipher!";
            Cipher cipher = new Vernam_Cipher(msg);

            Assert.IsNotNull(cipher);
            cipher = null;
            Assert.IsNull(cipher);
            cipher         = new Vernam_Cipher(msg);
            cipher.Message = cipher.Encrypt();
            string expected = cipher.Decrypt();

            Assert.AreEqual(expected, msg, true);
        }
Example #3
0
        public void Is_InitializedTest()
        {
            Cipher cipher = new Vernam_Cipher("Hello World");

            Assert.IsTrue(cipher.Is_Initialized());
        }
Example #4
0
        public void Is_Key_ValidTest()
        {
            Cipher cipher = new Vernam_Cipher("Hello World");

            Assert.IsTrue(cipher.Is_Key_Valid());
        }