예제 #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[] {  });
        }
예제 #2
0
        public virtual void TestEquals()
        {
            var q = NewQuery();

            q.Constrain(_array[0]);
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
예제 #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[] {});
        }
예제 #4
0
        public virtual void TestSmaller()
        {
            var q = NewQuery();

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

            q.Constrain(new STByteWUTestCase
                            (0));
            SodaTestUtil.ExpectOne(q, _array[0]);
        }
예제 #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]);
        }
예제 #7
0
        public virtual void TestEqualsTrue()
        {
            var q = NewQuery();

            q.Constrain(new STBooleanTestCase
                            (true));
            SodaTestUtil.ExpectOne(q, new STBooleanTestCase
                                       (true));
        }
예제 #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]);
        }
예제 #9
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]);
        }
예제 #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]);
        }
예제 #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));
        }
예제 #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));
        }
예제 #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));
        }
예제 #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"));
        }
예제 #15
0
        public virtual void TestNull()
        {
            var q = NewQuery();

            q.Constrain(new STBooleanWUTestCase
                            ());
            q.Descend(Descendant).Constrain(null);
            SodaTestUtil.ExpectOne(q, new STBooleanWUTestCase
                                       ());
        }
예제 #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"));
        }
예제 #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"));
        }
예제 #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]);
        }
예제 #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"));
        }
예제 #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
                                       ());
        }
예제 #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"));
        }
예제 #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]);
        }
예제 #23
0
        public virtual void TestCaseInsenstiveContains()
        {
            var q = NewQuery();

            q.Constrain(typeof(STStringTestCase
                               ));
            q.Constrain(new _IEvaluation_199());
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       ("dod"));
        }
예제 #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"));
        }
예제 #25
0
        public virtual void TestDescendantEquals()
        {
            var q = NewQuery();

            q.Constrain(new STStringTestCase
                            ());
            q.Descend("str").Constrain("bbb");
            SodaTestUtil.ExpectOne(q, new STStringTestCase
                                       ("bbb"));
        }
예제 #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"));
        }
예제 #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]);
        }
예제 #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]);
        }
예제 #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]);
        }
예제 #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]);
        }