Beispiel #1
0
        public virtual void TestEndsWith()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                            ("do"));
            q.Descend("str").Constraints().EndsWith(true);
            Expect(q, new int[] {  });
            q = NewQuery();
            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                            ("od"));
            q.Descend("str").Constraints().EndsWith(true);
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                                       ("dod"));
            q = NewQuery();
            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                            ("D"));
            q.Descend("str").Constraints().EndsWith(false);
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                                       ("dod"));
            q = NewQuery();
            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                            ("dodo"));
            // COR-413
            q.Descend("str").Constraints().EndsWith(false);
            Expect(q, new int[] {  });
        }
Beispiel #2
0
        public virtual void TestEquals()
        {
            var q = NewQuery();

            q.Constrain(_array[0]);
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #3
0
        public virtual void TestEndsWith()
        {
            var q = NewQuery();

            q.Constrain(new STStringTestCase
                            ("do"));
            q.Descend("str").Constraints().EndsWith(true);
            Expect(q, new int[] {});
            q = NewQuery();
            q.Constrain(new STStringTestCase
                            ("od"));
            q.Descend("str").Constraints().EndsWith(true);
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       ("dod"));
            q = NewQuery();
            q.Constrain(new STStringTestCase
                            ("D"));
            q.Descend("str").Constraints().EndsWith(false);
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       ("dod"));
            q = NewQuery();
            q.Constrain(new STStringTestCase
                            ("dodo"));
            // COR-413
            q.Descend("str").Constraints().EndsWith(false);
            Expect(q, new int[] {});
        }
Beispiel #4
0
        public virtual void TestSmaller()
        {
            var q = NewQuery();

            q.Constrain(new STByteTestCase(1));
            q.Descend(Descendant).Constraints().Smaller();
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #5
0
        public virtual void TestEquals()
        {
            var q = NewQuery();

            q.Constrain(new STByteWUTestCase
                            (0));
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #6
0
        public virtual void TestEquals()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STByteWUTestCase
                            ((byte)0));
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #7
0
        public virtual void TestEqualsTrue()
        {
            var q = NewQuery();

            q.Constrain(new STBooleanTestCase
                            (true));
            SodaTestUtil.ExpectOne(q, new STBooleanTestCase
                                       (true));
        }
Beispiel #8
0
        public virtual void TestSmaller()
        {
            var q = NewQuery();

            q.Constrain(new STIntegerWUTestCase
                            (1));
            q.Descend("i_int").Constraints().Smaller();
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
        public virtual void TestSmaller()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STCharWUTestCase
                            ((char)1));
            q.Descend(Descendant).Constraints().Smaller();
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #10
0
        public virtual void TestSmaller()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STByteTestCase((
                                                                                                byte)1));
            q.Descend(Descendant).Constraints().Smaller();
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #11
0
        public virtual void TestEqualsTrue()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STBooleanTestCase
                            (true));
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STBooleanTestCase
                                       (true));
        }
Beispiel #12
0
        public virtual void TestEqualsTrue()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STBooleanWUTestCase
                            (true));
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STBooleanWUTestCase
                                       (true));
        }
Beispiel #13
0
        public virtual void TestNull()
        {
            var q = NewQuery();

            q.Constrain(new STStringTestCase
                            (null));
            q.Descend("str").Constrain(null);
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       (null));
        }
Beispiel #14
0
        public virtual void TestEvaluation()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                            (null));
            q.Constrain(new _IEvaluation_187());
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                                       ("dod"));
        }
Beispiel #15
0
        public virtual void TestNull()
        {
            var q = NewQuery();

            q.Constrain(new STBooleanWUTestCase
                            ());
            q.Descend(Descendant).Constrain(null);
            SodaTestUtil.ExpectOne(q, new STBooleanWUTestCase
                                       ());
        }
Beispiel #16
0
        public virtual void TestContains()
        {
            var q = NewQuery();

            q.Constrain(new STStringTestCase
                            ("od"));
            q.Descend("str").Constraints().Contains();
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       ("dod"));
        }
Beispiel #17
0
        public virtual void TestCaseInsenstiveContains()
        {
            IQuery q = NewQuery();

            q.Constrain(typeof(Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                               ));
            q.Constrain(new _IEvaluation_199());
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                                       ("dod"));
        }
Beispiel #18
0
        public virtual void TestBothNull()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Typedhierarchy.STRTH1TestCase
                            ());
            q.Descend("foo1").Constrain(null);
            q.Descend("h2").Constrain(null);
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #19
0
        public virtual void TestContains()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                            ("od"));
            q.Descend("str").Constraints().Contains();
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                                       ("dod"));
        }
Beispiel #20
0
        public virtual void TestNull()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STBooleanWUTestCase
                            ());
            q.Descend(Descendant).Constrain(null);
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STBooleanWUTestCase
                                       ());
        }
Beispiel #21
0
        public virtual void TestEvaluation()
        {
            var q = NewQuery();

            q.Constrain(new STStringTestCase
                            (null));
            q.Constrain(new _IEvaluation_187());
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       ("dod"));
        }
Beispiel #22
0
        public virtual void TestBothNull()
        {
            var q = NewQuery();

            q.Constrain(new STTH1TestCase
                            ());
            q.Descend("foo1").Constrain(null);
            q.Descend("h2").Constrain(null);
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #23
0
        public virtual void TestCaseInsenstiveContains()
        {
            var q = NewQuery();

            q.Constrain(typeof(STStringTestCase
                               ));
            q.Constrain(new _IEvaluation_199());
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       ("dod"));
        }
Beispiel #24
0
        public virtual void TestContains()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STStringUTestCase
                            ("od"));
            q.Descend("str").Constraints().Contains();
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STStringUTestCase
                                       ("dod"));
        }
Beispiel #25
0
        public virtual void TestDescendantEquals()
        {
            var q = NewQuery();

            q.Constrain(new STStringTestCase
                            ());
            q.Descend("str").Constrain("bbb");
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       ("bbb"));
        }
Beispiel #26
0
        /// <summary>
        /// Magic:
        /// Execute any node in the query graph.
        /// </summary>
        /// <remarks>
        /// Magic:
        /// Execute any node in the query graph.
        /// The data for this example can be found in STTH1.java.
        /// </remarks>
        public virtual void TestExecuteAnyNode()
        {
            IQuery q = NewQuery();

            q.Constrain(new STTH1TestCase().CreateData()[5]);
            q = q.Descend("h2").Descend("h3");
            //	We only get one STTH3 here, because the query is
            //	constrained by the STTH2 with the "str2" member.
            SodaTestUtil.ExpectOne(q, new STTH3("str3"));
        }
Beispiel #27
0
        public virtual void TestEquals()
        {
            var q = NewQuery();

            q.Constrain(new STByteTestCase(0));
            // Primitive default values are ignored, so we need an
            // additional constraint:
            q.Descend(Descendant).Constrain((byte)0);
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
Beispiel #28
0
        public virtual void TestOrAndOr()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Joins.Untyped.STOrUTestCase(null
                                                                                          , null));
            (q.Descend("orInt").Constrain(5).Or(q.Descend("orString").Constrain(null))).And(q
                                                                                            .Descend("orInt").Constrain(int.MaxValue - 1).Or(q.Descend("orString").Constrain
                                                                                                                                                 ("joho")));
            SodaTestUtil.ExpectOne(q, _array[4]);
        }
Beispiel #29
0
        public virtual void TestOrAndOr()
        {
            var q = NewQuery();

            q.Constrain(new STOrUTestCase(null
                                          , null));
            (q.Descend("orInt").Constrain(5).Or(q.Descend("orString").Constrain(null))).And(q
                                                                                            .Descend("orInt").Constrain(int.MaxValue - 1).Or(q.Descend("orString").Constrain
                                                                                                                                                 ("joho")));
            SodaTestUtil.ExpectOne(q, _array[4]);
        }
Beispiel #30
0
        public virtual void TestEquals()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STByteTestCase((
                                                                                                byte)0));
            // Primitive default values are ignored, so we need an
            // additional constraint:
            q.Descend(Descendant).Constrain((byte)0);
            SodaTestUtil.ExpectOne(q, _array[0]);
        }