예제 #1
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());
        }
예제 #2
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);
        }
예제 #3
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());
        }
예제 #4
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);
        }
예제 #5
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);
        }
예제 #6
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);
        }
        protected override string GetColumnCreationMethod(SqlColumn column)
        {
            var type = column.Types[Version];

            return(type.SqlTypeInfo switch
            {
                SqlInteger _ => $"{nameof(SqLite3Columns.AddInteger)}(\"{column.Name}\"",
                SqlReal _ => $"{nameof(SqLite3Columns.AddReal)}(\"{column.Name}\"",
                SqlText _ => $"{nameof(SqLite3Columns.AddText)}(\"{column.Name}\"",
                SqlBlob _ => $"{nameof(SqLite3Columns.AddBlob)}(\"{column.Name}\"",
                _ => throw new NotImplementedException($"Unmapped type: {type.SqlTypeInfo}"),
            });
예제 #8
0
 public void CreateParamFromValue()
 {
     Assert.Throws <TypeCannotBeUsedAsAClrTypeException>(() => SqlReal.GetTypeHandler().CreateParamFromValue("Test", null));
 }
예제 #9
0
 public void GetTypeHandler()
 {
     Assert.IsInstanceOf <SqlTypeHandler>(SqlReal.GetTypeHandler());
 }