コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }