예제 #1
0
        public void ConvertToSuccessTest()
        {
            var c  = new StringBytesArrayTypeConverter();
            var b  = Convert.FromBase64String("XXXX");
            var r2 = c.ConvertTo(b, typeof(string)) as string;

            Assert.AreEqual(r2, "XXXX");
        }
예제 #2
0
        public void CanConvertFromTests()
        {
            var c  = new StringBytesArrayTypeConverter();
            var r1 = c.CanConvertFrom(null, typeof(string));

            Assert.IsTrue(r1);
            var r2 = c.CanConvertFrom(null, typeof(byte));

            Assert.IsFalse(r2);
        }
예제 #3
0
        public void ConvertFromSuccessTest()
        {
            var c  = new StringBytesArrayTypeConverter();
            var r2 = c.ConvertFrom("XXXX") as byte[];
            var r3 = Convert.FromBase64String("XXXX");

            Assert.AreEqual(r2.Length, r3.Length);
            for (var i = 0; i < r2.Length; i++)
            {
                Assert.AreEqual(r2[i], r3[i]);
            }
        }
예제 #4
0
        public void ConvertToInt()
        {
            var c = new StringBytesArrayTypeConverter();

            c.ConvertTo("ZZZ", typeof(int));
        }
예제 #5
0
        public void ConvertFromInt()
        {
            var c = new StringBytesArrayTypeConverter();

            c.ConvertFrom(24);
        }