示例#1
0
        public void Test_Base64()
        {
            string Text1 = "Man";
            string Code1 = "TWFu";

            Assert.AreEqual(Text1, CryptoUtils.Base64_Decode(Code1));
            Assert.AreEqual(Code1, CryptoUtils.Base64_Encode(Text1));

            string Text2 = "I.T.T. Marconi Rovereto";
            string Code2 = "SS5ULlQuIE1hcmNvbmkgUm92ZXJldG8=";

            Assert.AreEqual(Text2, CryptoUtils.Base64_Decode(Code2));
            Assert.AreEqual(Code2, CryptoUtils.Base64_Encode(Text2));

            Assert.AreNotEqual(Code2, CryptoUtils.Base64_Encode("ITT - Marconi Rovereto"));
        }