Exemplo n.º 1
0
        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]));
        }
Exemplo n.º 2
0
        public void CreateMetaData()
        {
            var meta = SqlBigInt.GetTypeHandler().CreateMetaData("Test");

            Assert.AreEqual(SqlDbType.BigInt, meta.SqlDbType);
            Assert.AreEqual("Test", meta.Name);
        }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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());
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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)));
        }
Exemplo n.º 8
0
 public void GetTypeHandler()
 {
     Assert.IsInstanceOf <SqlTypeHandler>(SqlBigInt.GetTypeHandler());
 }