public virtual void TestList4Update5() { DeleteBase("list5.ndb"); var odb = Open("list5.ndb"); var o = new ObjectWithListOfInteger("test"); o.GetListOfIntegers().Add(Convert.ToInt32("100")); odb.Store(o); odb.Close(); var size = 100; for (var i = 0; i < size; i++) { var odb2 = Open("list5.ndb"); var query = odb2.Query <ObjectWithListOfInteger>(); var ll = query.Execute <ObjectWithListOfInteger>(true); var o2 = ll.GetFirst(); o2.GetListOfIntegers().Add(200 + i); odb2.Store(o2); odb2.Close(); } var odb3 = Open("list5.ndb"); var query1 = odb3.Query <ObjectWithListOfInteger>(); var l = query1.Execute <ObjectWithListOfInteger>(true); AssertEquals(1, l.Count); var o3 = l.GetFirst(); AssertEquals(size + 1, o3.GetListOfIntegers().Count); odb3.Close(); DeleteBase("list5.ndb"); }
public virtual void TestList4Update3() { DeleteBase("list5.ndb"); var odb = Open("list5.ndb"); var o = new ObjectWithListOfInteger("test"); o.GetListOfIntegers().Add(Convert.ToInt32("100")); odb.Store(o); odb.Close(); var odb2 = Open("list5.ndb"); var query = odb2.Query <ObjectWithListOfInteger>(); var l = query.Execute <ObjectWithListOfInteger>(true); var o2 = l.GetFirst(); o2.GetListOfIntegers().Clear(); o2.GetListOfIntegers().Add(Convert.ToInt32("200")); odb2.Store(o2); odb2.Close(); odb2 = Open("list5.ndb"); var query1 = odb2.Query <ObjectWithListOfInteger>(); l = query1.Execute <ObjectWithListOfInteger>(true); AssertEquals(1, l.Count); var o3 = l.GetFirst(); AssertEquals(1, o3.GetListOfIntegers().Count); AssertEquals(Convert.ToInt32("200"), o3.GetListOfIntegers()[0]); odb2.Close(); DeleteBase("list5.ndb"); }
public virtual void TestList4Update4Middle() { DeleteBase("list5.ndb"); var odb = Open("list5.ndb"); var o = new ObjectWithListOfInteger("test1"); o.GetListOfIntegers().Add(Convert.ToInt32("101")); odb.Store(o); o = new ObjectWithListOfInteger("test2"); o.GetListOfIntegers().Add(Convert.ToInt32("102")); odb.Store(o); o = new ObjectWithListOfInteger("test3"); o.GetListOfIntegers().Add(Convert.ToInt32("103")); odb.Store(o); odb.Close(); var size = 100; for (var i = 0; i < size; i++) { var odb2 = Open("list5.ndb"); var query = odb2.Query <ObjectWithListOfInteger>(); query.Descend("name").Constrain((object)"test2").Equal(); var ll = query.Execute <ObjectWithListOfInteger>(); var o2 = ll.GetFirst(); o2.GetListOfIntegers().Clear(); o2.GetListOfIntegers().Add(200 + i); odb2.Store(o2); odb2.Close(); } var odb3 = Open("list5.ndb"); var query2 = odb3.Query <ObjectWithListOfInteger>(); query2.Descend("name").Constrain((object)"test2").Equal(); var l = query2.Execute <ObjectWithListOfInteger>(); AssertEquals(1, l.Count); var o3 = l.GetFirst(); AssertEquals(1, o3.GetListOfIntegers().Count); AssertEquals(200 + size - 1, o3.GetListOfIntegers()[0]); odb3.Close(); DeleteBase("list5.ndb"); }
public virtual void TestList4Update5() { DeleteBase("list5.ndb"); var odb = Open("list5.ndb"); var o = new ObjectWithListOfInteger("test"); o.GetListOfIntegers().Add(Convert.ToInt32("100")); odb.Store(o); odb.Close(); var size = 100; for (var i = 0; i < size; i++) { var odb2 = Open("list5.ndb"); var query = odb2.Query<ObjectWithListOfInteger>(); var ll = query.Execute<ObjectWithListOfInteger>(true); var o2 = ll.GetFirst(); o2.GetListOfIntegers().Add(200 + i); odb2.Store(o2); odb2.Close(); } var odb3 = Open("list5.ndb"); var query1 = odb3.Query<ObjectWithListOfInteger>(); var l = query1.Execute<ObjectWithListOfInteger>(true); AssertEquals(1, l.Count); var o3 = l.GetFirst(); AssertEquals(size + 1, o3.GetListOfIntegers().Count); odb3.Close(); DeleteBase("list5.ndb"); }
public virtual void TestList4Update4Middle2() { DeleteBase("list5.ndb"); var odb = Open("list5.ndb"); var o = new ObjectWithListOfInteger("test1"); o.GetListOfIntegers().Add(Convert.ToInt32("101")); odb.Store(o); o = new ObjectWithListOfInteger("test2"); o.GetListOfIntegers().Add(Convert.ToInt32("102")); odb.Store(o); o = new ObjectWithListOfInteger("test3"); o.GetListOfIntegers().Add(Convert.ToInt32("103")); odb.Store(o); odb.Close(); var size = 100; for (var i = 0; i < size; i++) { var odb2 = Open("list5.ndb"); var query2 = odb2.Query<ObjectWithListOfInteger>(); query2.Descend("name").Constrain((object) "test2").Equal(); var ll = query2.Execute<ObjectWithListOfInteger>(); var o2 = ll.GetFirst(); o2.GetListOfIntegers().Add(200 + i); odb2.Store(o2); odb2.Close(); } var odb3 = Open("list5.ndb"); var query = odb3.Query<ObjectWithListOfInteger>(); query.Descend("name").Constrain((object) "test2").Equal(); var l = query.Execute<ObjectWithListOfInteger>(); AssertEquals(1, l.Count); var o3 = l.GetFirst(); AssertEquals(1 + size, o3.GetListOfIntegers().Count); odb3.Close(); DeleteBase("list5.ndb"); }
public virtual void TestList4Update3() { DeleteBase("list5.ndb"); var odb = Open("list5.ndb"); var o = new ObjectWithListOfInteger("test"); o.GetListOfIntegers().Add(Convert.ToInt32("100")); odb.Store(o); odb.Close(); var odb2 = Open("list5.ndb"); var query = odb2.Query<ObjectWithListOfInteger>(); var l = query.Execute<ObjectWithListOfInteger>(true); var o2 = l.GetFirst(); o2.GetListOfIntegers().Clear(); o2.GetListOfIntegers().Add(Convert.ToInt32("200")); odb2.Store(o2); odb2.Close(); odb2 = Open("list5.ndb"); var query1 = odb2.Query<ObjectWithListOfInteger>(); l = query1.Execute<ObjectWithListOfInteger>(true); AssertEquals(1, l.Count); var o3 = l.GetFirst(); AssertEquals(1, o3.GetListOfIntegers().Count); AssertEquals(Convert.ToInt32("200"), o3.GetListOfIntegers()[0]); odb2.Close(); DeleteBase("list5.ndb"); }