public static QueryByExampleTestCase.LinkedList NewLongCircularList() { QueryByExampleTestCase.LinkedList head = new QueryByExampleTestCase.LinkedList(); QueryByExampleTestCase.LinkedList tail = head; for (int i = 1; i < Count; i++) { tail._next = new QueryByExampleTestCase.LinkedList(); tail = tail._next; tail._depth = i; } tail._next = head; return(head); }
public virtual void TestByIdentity() { IQuery q = Db().Query(); q.Constrain(typeof(QueryByExampleTestCase.LinkedList)); IObjectSet result = q.Execute(); Assert.AreEqual(Count, result.Count); while (result.HasNext()) { Db().Delete(result.Next()); } q = Db().Query(); q.Constrain(typeof(QueryByExampleTestCase.LinkedList)); result = q.Execute(); Assert.AreEqual(0, result.Count); QueryByExampleTestCase.LinkedList newList = QueryByExampleTestCase.LinkedList.NewLongCircularList (); Db().Store(newList); q = Db().Query(); q.Constrain(newList); result = q.Execute(); Assert.AreEqual(1, result.Count); }
public static QueryByExampleTestCase.LinkedList NewLongCircularList() { QueryByExampleTestCase.LinkedList head = new QueryByExampleTestCase.LinkedList(); QueryByExampleTestCase.LinkedList tail = head; for (int i = 1; i < Count; i++) { tail._next = new QueryByExampleTestCase.LinkedList(); tail = tail._next; tail._depth = i; } tail._next = head; return head; }