示例#1
0
        public void GetRawValue()
        {
            SqlType type = new SqlNText("ру́сский", ParameterDirection.Input);
            Assert.AreEqual("ру́сский", type.GetRawValue());

            type = new SqlNText(null, ParameterDirection.Input);
            Assert.Null(type.GetRawValue());
        }
示例#2
0
        public void GetParameter()
        {
            SqlType type = new SqlNText("ру́сский", ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.NText, "ру́сский", size: -1);

            type = new SqlNText(null, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.NText, DBNull.Value, size: -1);
        }
示例#3
0
        public void GetRawValue()
        {
            SqlType type = new SqlNText("ру́сский", ParameterDirection.Input);

            Assert.AreEqual("ру́сский", type.GetRawValue());

            type = new SqlNText(null, ParameterDirection.Input);
            Assert.Null(type.GetRawValue());
        }
示例#4
0
        public void GetParameter()
        {
            SqlType type = new SqlNText("ру́сский", ParameterDirection.Input);

            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.NText, "ру́сский", size: -1);

            type = new SqlNText(null, ParameterDirection.Input);
            TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.NText, DBNull.Value, size: -1);
        }
示例#5
0
        public void CreateMetaData()
        {
            Assert.Throws<TypeCannotBeUsedAsAClrTypeException>(() => SqlNText.GetTypeHandler().CreateMetaData(null));

            SqlTypeHandler col = new SqlNText("ру́сский", ParameterDirection.Input);
            var meta = col.CreateMetaData("Test");
            Assert.AreEqual(SqlDbType.NText, meta.SqlDbType);
            Assert.AreEqual(-1, meta.MaxLength);
            Assert.AreEqual("Test", meta.Name);
        }
示例#6
0
        public void CreateMetaData()
        {
            Assert.Throws <TypeCannotBeUsedAsAClrTypeException>(() => SqlNText.GetTypeHandler().CreateMetaData(null));

            SqlTypeHandler col  = new SqlNText("ру́сский", ParameterDirection.Input);
            var            meta = col.CreateMetaData("Test");

            Assert.AreEqual(SqlDbType.NText, meta.SqlDbType);
            Assert.AreEqual(-1, meta.MaxLength);
            Assert.AreEqual("Test", meta.Name);
        }
示例#7
0
 public void CreateParamFromValue()
 {
     Assert.Throws <TypeCannotBeUsedAsAClrTypeException>(() => SqlNText.GetTypeHandler().CreateParamFromValue("Test", null));
 }
示例#8
0
 public void GetTypeHandler()
 {
     Assert.IsInstanceOf <SqlTypeHandler>(SqlNText.GetTypeHandler());
 }