public void GetRawValue() { SqlType type = new SqlFloat(5.27d, ParameterDirection.Input); Assert.AreEqual(5.27d, type.GetRawValue()); type = new SqlFloat(null, ParameterDirection.Input); Assert.Null(type.GetRawValue()); }
public void GetParameter() { SqlType type = new SqlFloat(5.27d, ParameterDirection.Input); TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.Float, 5.27d); type = new SqlFloat(null, ParameterDirection.Input); TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.Float, DBNull.Value); }
public void CreateMetaData() { Assert.Throws<TypeCannotBeUsedAsAClrTypeException>(() => SqlFloat.GetTypeHandler().CreateMetaData(null)); SqlTypeHandler col = new SqlFloat(5.27d, ParameterDirection.Input); var meta = col.CreateMetaData("Test"); Assert.AreEqual(SqlDbType.Float, meta.SqlDbType); Assert.AreEqual(53, meta.Precision); Assert.AreEqual("Test", meta.Name); }
public void CreateMetaData() { Assert.Throws <TypeCannotBeUsedAsAClrTypeException>(() => SqlFloat.GetTypeHandler().CreateMetaData(null)); SqlTypeHandler col = new SqlFloat(5.27d, ParameterDirection.Input); var meta = col.CreateMetaData("Test"); Assert.AreEqual(SqlDbType.Float, meta.SqlDbType); Assert.AreEqual(53, meta.Precision); Assert.AreEqual("Test", meta.Name); }
public void CreateParamFromValue() { Assert.Throws <TypeCannotBeUsedAsAClrTypeException>(() => SqlFloat.GetTypeHandler().CreateParamFromValue("Test", null)); }
public void GetTypeHandler() { Assert.IsInstanceOf <SqlTypeHandler>(SqlFloat.GetTypeHandler()); }