public void SetKeyTest() { MonoAlphaSubCipher encryptorOne = new MonoAlphaSubCipher(); MonoAlphaSubCipher encryptorTwo = new MonoAlphaSubCipher(); TestCtor(encryptorOne); TestCtor(encryptorTwo); encryptorTwo.GenKey(); encryptorOne.SetKey(encryptorTwo.GetKey()); CompareKeys(encryptorTwo.GetKey(), encryptorOne.GetKey()); }
public void GenKeyTest() { MonoAlphaSubCipher masc = new MonoAlphaSubCipher(); TestCtor(masc); masc.GenKey(); Assert.AreNotEqual(0, masc.GetKey(), "key was not intialized"); }
static void TestStrEnc(MonoAlphaSubCipher cipher, string encStr) { Assert.IsNotNull(cipher.GetKey(), "Key was not Generated"); Assert.AreNotEqual(TEST_STR, encStr, "String did not encrypt"); }
static void TestCtor(MonoAlphaSubCipher cipher) { Assert.IsNull(cipher.GetKey(), "Incorrect intialized key Found"); }