コード例 #1
0
        public async Task NextAsync()
        {
            DateTimeType type    = NHibernateUtil.DateTime2;
            object       current = DateTime.Now.AddMilliseconds(-1);
            object       next    = await(type.NextAsync(current, null, CancellationToken.None));

            Assert.That(next, Is.TypeOf <DateTime>().And.GreaterThan(current));
        }
コード例 #2
0
        public async Task NextAsync()
        {
            DateTimeType type    = (DateTimeType)NHibernateUtil.DateTime;
            object       current = DateTime.Parse("2004-01-01");
            object       next    = await(type.NextAsync(current, null, CancellationToken.None));

            Assert.IsTrue(next is DateTime, "Next should be DateTime");
            Assert.IsTrue((DateTime)next > (DateTime)current,
                          "next should be greater than current (could be equal depending on how quickly this occurs)");
        }