コード例 #1
0
        public void ConvertFrom()
        {
            MachineKeyValidationConverter cv = new MachineKeyValidationConverter();
            object o;

            o = cv.ConvertFrom(null, null, "MD5");
            Assert.AreEqual(typeof(MachineKeyValidation), o.GetType(), "A1");
            Assert.AreEqual("MD5", o.ToString(), "A2");
            o = cv.ConvertFrom(null, null, "AES");
            Assert.AreEqual("AES", o.ToString(), "A3");
        }
コード例 #2
0
        public void ConvertFrom_TypeError()
        {
            MachineKeyValidationConverter cv = new MachineKeyValidationConverter();
            object o;

            o = cv.ConvertFrom(null, null, 6);
            Assert.IsNull(o, "A1");
        }
コード例 #3
0
        public void ConvertFrom()
        {
            MachineKeyValidationConverter cv = new MachineKeyValidationConverter();
            object o;

            o = cv.ConvertFrom(null, null, "MD5");
            Assert.AreEqual(typeof(MachineKeyValidation), o.GetType(), "typeof");
            Assert.AreEqual("MD5", o.ToString(), "MD5");

            o = cv.ConvertFrom(null, null, "SHA1");
            Assert.AreEqual("SHA1", o.ToString(), "SHA1");

            // 3DES in, TripleDES out
            o = cv.ConvertFrom(null, null, "3DES");
            Assert.AreEqual("TripleDES", o.ToString(), "3DES");

            o = cv.ConvertFrom(null, null, "AES");
            Assert.AreEqual("AES", o.ToString(), "AES");
            o = cv.ConvertFrom(null, null, "HMACSHA256");
            Assert.AreEqual("HMACSHA256", o.ToString(), "HMACSHA256");

            o = cv.ConvertFrom(null, null, "HMACSHA384");
            Assert.AreEqual("HMACSHA384", o.ToString(), "HMACSHA384");

            o = cv.ConvertFrom(null, null, "HMACSHA512");
            Assert.AreEqual("HMACSHA512", o.ToString(), "HMACSHA512");
        }
コード例 #4
0
        public void ConvertFrom_Custom()
        {
            MachineKeyValidationConverter cv = new MachineKeyValidationConverter();

            cv.ConvertFrom(null, null, "Custom");
        }
コード例 #5
0
        public void ConvertFrom_CaseSensitive()
        {
            MachineKeyValidationConverter cv = new MachineKeyValidationConverter();

            cv.ConvertFrom(null, null, "sha1");
        }