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"); }
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); }
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]); } }
public void ConvertToInt() { var c = new StringBytesArrayTypeConverter(); c.ConvertTo("ZZZ", typeof(int)); }
public void ConvertFromInt() { var c = new StringBytesArrayTypeConverter(); c.ConvertFrom(24); }