/// <summary>Only</summary> public virtual void TestNothing() { IQuery q = NewQuery(); q.Descend("child"); SodaTestUtil.Expect(q, _array); }
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[] {}); }
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[] { }); }
public virtual void TestEquals() { var q = NewQuery(); q.Constrain(_array[0]); SodaTestUtil.ExpectOne(q, _array[0]); }
public virtual void TestNotIdentity() { var q = NewQuery(); q.Constrain(new STStringUTestCase ("aaa")); var set = q.Execute(); var identityConstraint = (STStringUTestCase)set.Next (); identityConstraint.str = null; q = NewQuery(); q.Constrain(identityConstraint).Identity().Not(); identityConstraint.str = "aaa"; SodaTestUtil.Expect(q, new object[] { new STStringUTestCase (null), new STStringUTestCase( "bbb"), new STStringUTestCase( "dod") }); }
public virtual void TestSmaller() { var q = NewQuery(); q.Constrain(new STByteTestCase(1)); q.Descend(Descendant).Constraints().Smaller(); SodaTestUtil.ExpectOne(q, _array[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]); }
public virtual void TestEquals() { var q = NewQuery(); q.Constrain(new STByteWUTestCase (0)); SodaTestUtil.ExpectOne(q, _array[0]); }
/// <summary> /// Magic: /// Query for all objects with a known attribute, /// independant of the class or even if you don't /// know the class. /// </summary> /// <remarks> /// Magic: /// Query for all objects with a known attribute, /// independant of the class or even if you don't /// know the class. /// </remarks> public virtual void TestUnconstrainedClass() { IQuery q = NewQuery(); q.Descend("str").Constrain("aaa"); SodaTestUtil.Expect(q, new object[] { new Db4objects.Db4o.Tests.Common.Soda.Experiments.STMagicTestCase ("aaa"), new STStringTestCase("aaa"), new STStringUTestCase("aaa") }); }
public virtual void TestEquals() { IQuery q = NewQuery(); q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STLongTestCase(long.MinValue )); SodaTestUtil.Expect(q, new object[] { new Db4objects.Db4o.Tests.Common.Soda.Classes.Simple.STLongTestCase (long.MinValue) }); }
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)); }
// public void testRegularExpression() { // Query q = newQuery(); // q.constrain(STMagicTestCase.class); // Query qStr = q.descend("str"); // final Pattern pattern = Pattern.compile("a*x"); // qStr.constrain(new Evaluation() { // public void evaluate(Candidate candidate) { // candidate.include(pattern.matcher(((String) candidate.getObject())).matches()); // } // }); // com.db4o.db4ounit.common.soda.util.SodaTestUtil.expectOne(q, _array[1]); // } /// <summary> /// Magic: /// Querying for an implemented Interface. /// </summary> /// <remarks> /// Magic: /// Querying for an implemented Interface. /// Using an Evaluation allows calls to the interface methods /// during the run of the query.s /// </remarks> public virtual void TestInterface() { IQuery q = NewQuery(); q.Constrain(typeof(ISTInterface)); q.Constrain(new _IEvaluation_117()); SodaTestUtil.Expect(q, new object[] { new Db4objects.Db4o.Tests.Common.Soda.Experiments.STMagicTestCase ("aaa"), new STStringTestCase("aaa") }); }
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.Classes.Simple.STByteTestCase(( byte)1)); q.Descend(Descendant).Constraints().Smaller(); SodaTestUtil.ExpectOne(q, _array[0]); }
public virtual void TestEquals() { IQuery q = NewQuery(); q.Constrain(new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STLongWUTestCase (long.MinValue)); SodaTestUtil.Expect(q, new object[] { new Db4objects.Db4o.Tests.Common.Soda.Wrapper.Untyped.STLongWUTestCase (long.MinValue) }); }
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)); }
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]); }
public virtual void TestEqualsTrue() { var q = NewQuery(); q.Constrain(new STBooleanTestCase (true)); SodaTestUtil.ExpectOne(q, new STBooleanTestCase (true)); }
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")); }
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")); }
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]); }
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]); }
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 ()); }
public virtual void TestNull() { var q = NewQuery(); q.Constrain(new STStringTestCase (null)); q.Descend("str").Constrain(null); SodaTestUtil.ExpectOne(q, new STStringTestCase (null)); }
public virtual void TestEvaluation() { var q = NewQuery(); q.Constrain(new STStringTestCase (null)); q.Constrain(new _IEvaluation_187()); SodaTestUtil.ExpectOne(q, new STStringTestCase ("dod")); }
public virtual void TestCaseInsenstiveContains() { var q = NewQuery(); q.Constrain(typeof(STStringTestCase )); q.Constrain(new _IEvaluation_199()); SodaTestUtil.ExpectOne(q, new STStringTestCase ("dod")); }
public virtual void TestContains() { var q = NewQuery(); q.Constrain(new STStringTestCase ("od")); q.Descend("str").Constraints().Contains(); SodaTestUtil.ExpectOne(q, new STStringTestCase ("dod")); }
public virtual void TestDescendantEquals() { var q = NewQuery(); q.Constrain(new STStringTestCase ()); q.Descend("str").Constrain("bbb"); SodaTestUtil.ExpectOne(q, new STStringTestCase ("bbb")); }
/// <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")); }
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]); }