Exemple #1
0
        public void Next()
        {
            Int64Type type    = (Int64Type)NHibernateUtil.Int64;
            object    current = (long)1;
            object    next    = type.Next(current, null);

            Assert.IsTrue(next is Int64, "Next should be Int64");
            Assert.AreEqual((long)2, (long)next, "current should have been incremented to 2");
        }
Exemple #2
0
        public async Task NextAsync()
        {
            Int64Type type    = (Int64Type)NHibernateUtil.Int64;
            object    current = (long)1;
            object    next    = await(type.NextAsync(current, null, CancellationToken.None));

            Assert.IsTrue(next is Int64, "Next should be Int64");
            Assert.AreEqual((long)2, (long)next, "current should have been incremented to 2");
        }
Exemple #3
0
        public void NullableWrapperDirty()
        {
            Int64Type type = (Int64Type)NHibernateUtil.Int64;

            Nullable <Int64> nullLong  = null;
            Nullable <Int64> valueLong = new Nullable <long>(5);
            Nullable <long>  fiveAgain = (long)5;

            using (ISession s = OpenSession())
            {
                Assert.IsTrue(type.IsDirty(nullLong, valueLong, (ISessionImplementor)s), "should be dirty - null to '5'");
                Assert.IsFalse(type.IsDirty(valueLong, fiveAgain, (ISessionImplementor)s), "should not be dirty - 5 to 5");
            }
        }
Exemple #4
0
        public async Task NullableWrapperDirtyAsync()
        {
            Int64Type type = (Int64Type)NHibernateUtil.Int64;

            long?nullLong  = null;
            long?valueLong = 5;
            long?fiveAgain = 5;

            using (ISession s = OpenSession())
            {
                Assert.IsTrue(await(type.IsDirtyAsync(nullLong, valueLong, (ISessionImplementor)s, CancellationToken.None)), "should be dirty - null to '5'");
                Assert.IsFalse(await(type.IsDirtyAsync(valueLong, fiveAgain, (ISessionImplementor)s, CancellationToken.None)), "should not be dirty - 5 to 5");
            }
        }
        public void NullableWrapperDirty()
        {
            Int64Type type = NHibernateUtil.Int64;

            long?nullLong  = null;
            long?valueLong = 5;
            long?fiveAgain = 5;

            using (ISession s = OpenSession())
            {
                Assert.IsTrue(type.IsDirty(nullLong, valueLong, (ISessionImplementor)s), "should be dirty - null to '5'");
                Assert.IsFalse(type.IsDirty(valueLong, fiveAgain, (ISessionImplementor)s), "should not be dirty - 5 to 5");
            }
        }
 public void Visit(Int64Type type) => CreateIntType(type);
Exemple #7
0
 public void Visit(Int64Type type) => GenerateArray(new Int64Array.Builder(), x => x);
 public void Visit(Int64Type type) => GenerateLongArray <long, Int64Array>((v, n, c, nc, o) => new Int64Array(v, n, c, nc, o), s => long.Parse(s));
 public void Visit(Int64Type type) => GenerateTestData <long, Int64Array, Int64Array.Builder>(type, x => x);
 public object Read(Int64Type int64Type) => reader.ReadInt64();
Exemple #11
0
 public void Visit(Int64Type type) => CreateNumberArray <long>(type);
Exemple #12
0
        public void Seed()
        {
            Int64Type type = (Int64Type)NHibernateUtil.Int64;

            Assert.IsTrue(type.Seed(null) is Int64, "seed should be int64");
        }
Exemple #13
0
 public void Write(Int64Type int64Type, object value) => writer.Write(Convert.ToInt64(value));
 public void Visit(Int64Type type) => _array     = new Int64Array(_data);
Exemple #15
0
        public async Task SeedAsync()
        {
            Int64Type type = (Int64Type)NHibernateUtil.Int64;

            Assert.IsTrue(await(type.SeedAsync(null, CancellationToken.None)) is Int64, "seed should be int64");
        }
Exemple #16
0
 public void Visit(Int64Type type)
 {
     ColumnDecoder = new Int64Decoder();
 }