Example #1
0
        public void GetParameter()
        {
            SqlType type = new SqlImage(data, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.Image, data, size: -1);

            type = new SqlImage(null, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.Image, DBNull.Value, size: -1);
        }
Example #2
0
        public void GetRawValue()
        {
            SqlType type = new SqlImage(data, ParameterDirection.Input);
            Assert.AreEqual(data, type.GetRawValue());

            type = new SqlImage(null, ParameterDirection.Input);
            Assert.Null(type.GetRawValue());
        }
Example #3
0
        public void CreateMetaData()
        {
            Assert.Throws<TypeCannotBeUsedAsAClrTypeException>(() => SqlImage.GetTypeHandler().CreateMetaData(null));

            SqlTypeHandler col = new SqlImage(data, ParameterDirection.Input);
            var meta = col.CreateMetaData("Test");
            Assert.AreEqual(SqlDbType.Image, meta.SqlDbType);
            Assert.AreEqual(-1, meta.MaxLength);
            Assert.AreEqual("Test", meta.Name);
        }