Ejemplo n.º 1
0
        public virtual void TestIdentity()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                            ("aaa"));
            IObjectSet set = q.Execute();

            Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase identityConstraint
                = (Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase)set.Next();
            identityConstraint.str = "hihs";
            q = NewQuery();
            q.Constrain(identityConstraint).Identity();
            identityConstraint.str = "aaa";
            SodaTestUtil.ExpectOne(q, new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                                       ("aaa"));
        }
Ejemplo n.º 2
0
        public virtual void TestNotIdentity()
        {
            IQuery q = NewQuery();

            q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                            ("aaa"));
            IObjectSet set = q.Execute();

            Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase identityConstraint
                = (Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase)set.Next();
            identityConstraint.str = null;
            q = NewQuery();
            q.Constrain(identityConstraint).Identity().Not();
            identityConstraint.str = "aaa";
            SodaTestUtil.Expect(q, new object[] { new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                                                      (null), new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase("bbb"
                                                                                                                                    ), new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase("dod") }
                                );
        }
Ejemplo n.º 3
0
 public void Evaluate(ICandidate candidate)
 {
     Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase sts = (Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STStringTestCase
                                                                              )candidate.GetObject();
     candidate.Include(sts.str.ToLower().IndexOf("od") >= 0);
 }