public void TestConvert_ValidArgs() { FileToBytesConverter c = new FileToBytesConverter(); byte[] output = (byte[])c.Convert("TestFile.txt", typeof(byte[]), null, CultureInfo.CurrentCulture); Assert.IsNotNull(output); Assert.AreNotEqual(0, output.Length); }
public void TestConvert_ValueNotString() { FileToBytesConverter c = new FileToBytesConverter(); byte[] output = (byte[])c.Convert(1, typeof(byte[]), null, CultureInfo.CurrentCulture); Assert.IsNotNull(output); Assert.AreEqual(0, output.Length); }
public void TestConvert_FileDoesntExist() { FileToBytesConverter c = new FileToBytesConverter(); byte[] output = (byte[])c.Convert("BadFile.txt", typeof(byte[]), null, CultureInfo.CurrentCulture); Assert.IsNotNull(output); Assert.AreEqual(0, output.Length); }
public void TestConvert_WrongTargetType() { FileToBytesConverter c = new FileToBytesConverter(); byte[] output = (byte[])c.Convert("TestFile.txt", typeof(string), null, CultureInfo.CurrentCulture); Assert.IsNotNull(output); Assert.AreEqual(0, output.Length); }