示例#1
0
        public void GetParameter()
        {
            SqlType type = new SqlReal(5.27f, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.Real, 5.27f);

            type = new SqlReal(null, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.Real, DBNull.Value);
        }
示例#2
0
        public void GetRawValue()
        {
            SqlType type = new SqlReal(5.27f, ParameterDirection.Input);
            Assert.AreEqual(5.27f, type.GetRawValue());

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

            SqlTypeHandler col = new SqlReal(5.27f, ParameterDirection.Input);
            var meta = col.CreateMetaData("Test");
            Assert.AreEqual(SqlDbType.Real, meta.SqlDbType);
            Assert.AreEqual(24, meta.Precision);
            Assert.AreEqual("Test", meta.Name);
        }