Example #1
0
        public void GetRawValue()
        {
            SqlType type = new SqlSmallMoney(5.27m, ParameterDirection.Input);
            Assert.AreEqual(5.27m, type.GetRawValue());

            type = new SqlSmallMoney(null, ParameterDirection.Input);
            Assert.Null(type.GetRawValue());
        }
Example #2
0
        public void GetParameter()
        {
            SqlType type = new SqlSmallMoney(5.27m, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.SmallMoney, 5.27m);

            type = new SqlSmallMoney(null, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.SmallMoney, DBNull.Value);
        }
Example #3
0
        public void CreateMetaData()
        {
            Assert.Throws<TypeCannotBeUsedAsAClrTypeException>(() => SqlSmallMoney.GetTypeHandler().CreateMetaData(null));

            SqlTypeHandler col = new SqlSmallMoney(5.27m, ParameterDirection.Input);
            var meta = col.CreateMetaData("Test");
            Assert.AreEqual(SqlDbType.SmallMoney, meta.SqlDbType);
            Assert.AreEqual("Test", meta.Name);
        }
Example #4
0
        public void GetRawValue()
        {
            SqlType type = new SqlSmallMoney(5.27m, ParameterDirection.Input);

            Assert.AreEqual(5.27m, type.GetRawValue());

            type = new SqlSmallMoney(null, ParameterDirection.Input);
            Assert.Null(type.GetRawValue());
        }
Example #5
0
        public void GetParameter()
        {
            SqlType type = new SqlSmallMoney(5.27m, ParameterDirection.Input);

            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.SmallMoney, 5.27m);

            type = new SqlSmallMoney(null, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.SmallMoney, DBNull.Value);
        }
Example #6
0
        public void CreateMetaData()
        {
            Assert.Throws <TypeCannotBeUsedAsAClrTypeException>(() => SqlSmallMoney.GetTypeHandler().CreateMetaData(null));

            SqlTypeHandler col  = new SqlSmallMoney(5.27m, ParameterDirection.Input);
            var            meta = col.CreateMetaData("Test");

            Assert.AreEqual(SqlDbType.SmallMoney, meta.SqlDbType);
            Assert.AreEqual("Test", meta.Name);
        }
Example #7
0
 public void CreateParamFromValue()
 {
     Assert.Throws <TypeCannotBeUsedAsAClrTypeException>(() => SqlSmallMoney.GetTypeHandler().CreateParamFromValue("Test", null));
 }
Example #8
0
 public void GetTypeHandler()
 {
     Assert.IsInstanceOf <SqlTypeHandler>(SqlSmallMoney.GetTypeHandler());
 }