public virtual void TestDate1()
        {
            var baseName = GetBaseName();

            SetUp(baseName);
            var odb     = Open(baseName);
            var myDates = new MyDates();
            var d1      = new DateTime();

            Thread.Sleep(100);

            var d2 = new DateTime();

            Thread.Sleep(100);
            var d3 = new DateTime();

            myDates.SetDate1(d1);
            myDates.SetDate2(d3);
            myDates.SetI(5);
            odb.Store(myDates);
            odb.Close();
            odb = Open(baseName);

            var query = odb.Query <MyDates>();

            query.Descend("date1").Constrain(d2).Smaller().Equal().And(
                query.Descend("date2").Constrain(d2).Greater().Equal()).And(
                query.Descend("i").Constrain(5).Equal());
            var objects = query.Execute <MyDates>();

            AssertEquals(1, objects.Count);
            odb.Close();
        }
Beispiel #2
0
        public virtual void TestDate1()
        {
            var baseName = GetBaseName();
            SetUp(baseName);
            var odb = Open(baseName);
            var myDates = new MyDates();
            var d1 = new DateTime();
            Thread.Sleep(100);

            var d2 = new DateTime();
            Thread.Sleep(100);
            var d3 = new DateTime();
            myDates.SetDate1(d1);
            myDates.SetDate2(d3);
            myDates.SetI(5);
            odb.Store(myDates);
            odb.Close();
            odb = Open(baseName);

            var query = odb.Query<MyDates>();
            query.Descend("date1").Constrain(d2).Smaller().Equal().And(
                query.Descend("date2").Constrain(d2).Greater().Equal()).And(
                    query.Descend("i").Constrain(5).Equal());
            var objects = query.Execute<MyDates>();
            AssertEquals(1, objects.Count);
            odb.Close();
        }