Пример #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());
        }
Пример #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);
        }
Пример #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);
        }
Пример #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());
        }
Пример #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);
        }
Пример #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);
        }
Пример #7
0
 public void CreateParamFromValue()
 {
     Assert.Throws <TypeCannotBeUsedAsAClrTypeException>(() => SqlSmallMoney.GetTypeHandler().CreateParamFromValue("Test", null));
 }
Пример #8
0
 public void GetTypeHandler()
 {
     Assert.IsInstanceOf <SqlTypeHandler>(SqlSmallMoney.GetTypeHandler());
 }