public void Length() { var type = new SqlBigInt(CompressionContext.NoCompression); Assert.Throws <ArgumentException>(() => type.GetValue(new byte[9])); Assert.Throws <ArgumentException>(() => type.GetValue(new byte[7])); }
public void CreateMetaData() { var meta = SqlBigInt.GetTypeHandler().CreateMetaData("Test"); Assert.AreEqual(SqlDbType.BigInt, meta.SqlDbType); Assert.AreEqual("Test", meta.Name); }
public void GetRawValue() { SqlType type = new SqlBigInt(5, ParameterDirection.Input); Assert.AreEqual((long)5, type.GetRawValue()); type = new SqlBigInt(null, ParameterDirection.Input); Assert.Null(type.GetRawValue()); }
public void GetParameter() { SqlType type = new SqlBigInt(5, ParameterDirection.Input); TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.BigInt, (long)5); type = new SqlBigInt(null, ParameterDirection.Input); TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.BigInt, DBNull.Value); }
public void GetRawValue() { SqlType type = new SqlBigInt(5, ParameterDirection.Input); Assert.AreEqual((long)5, type.GetRawValue()); type = new SqlBigInt(null, ParameterDirection.Input); Assert.Null(type.GetRawValue()); }
public void GetParameter() { SqlType type = new SqlBigInt(5, ParameterDirection.Input); TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.BigInt, (long)5); type = new SqlBigInt(null, ParameterDirection.Input); TestHelper.AssertSqlParameter(type.GetParameter(), SqlDbType.BigInt, DBNull.Value); }
public void GetValue() { var type = new SqlBigInt(CompressionContext.NoCompression); byte[] input; input = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F }; Assert.AreEqual(9223372036854775807, Convert.ToInt64(type.GetValue(input))); input = new byte[] { 0x82, 0x5A, 0x03, 0x1B, 0xD5, 0x3E, 0xCD, 0x71 }; Assert.AreEqual(8200279581513702018, Convert.ToInt64(type.GetValue(input))); input = new byte[] { 0x7F, 0xA5, 0xFC, 0xE4, 0x2A, 0xC1, 0x32, 0x8E }; Assert.AreEqual(-8200279581513702017, Convert.ToInt64(type.GetValue(input))); }
public void GetTypeHandler() { Assert.IsInstanceOf <SqlTypeHandler>(SqlBigInt.GetTypeHandler()); }