Ejemplo n.º 1
0
        public virtual void TestList1WithNull()
        {
            DeleteBase("list1.ndb");
            var odb    = Open("list1.ndb");
            var nb     = odb.Query <PlayerWithList>().Count();
            var player = new PlayerWithList("kiko");

            player.AddGame("volley-ball");
            player.AddGame("squash");
            player.AddGame("tennis");
            player.AddGame(null);
            odb.Store(player);
            odb.Close();
            var odb2  = Open("list1.ndb");
            var query = odb2.Query <PlayerWithList>();
            var l     = query.Execute <PlayerWithList>(true);

            AssertEquals(nb + 1, l.Count);
            // gets last player
            var player2 = l.GetFirst();

            AssertEquals(player.GetGame(2), player2.GetGame(2));
            odb2.Close();
            DeleteBase("list1.ndb");
        }
Ejemplo n.º 2
0
        /// <exception cref="System.Exception"></exception>
        public virtual void TestList1WithNull()
        {
            DeleteBase("list1.neodatis");
            NeoDatis.Odb.ODB odb = Open("list1.neodatis");
            long             nb  = odb.Count(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery(typeof(
                                                                                                         PlayerWithList)));
            PlayerWithList player = new PlayerWithList("kiko");

            player.AddGame("volley-ball");
            player.AddGame("squash");
            player.AddGame("tennis");
            player.AddGame(null);
            odb.Store(player);
            odb.Close();
            NeoDatis.Odb.ODB odb2 = Open("list1.neodatis");
            NeoDatis.Odb.Objects <PlayerWithList> l = odb2.GetObjects <PlayerWithList>(true);
            AssertEquals(nb + 1, l.Count);
            // gets last player
            PlayerWithList player2 = (PlayerWithList)l.GetFirst();

            AssertEquals(player.GetGame(2), player2.GetGame(2));
            odb2.Close();
            DeleteBase("list1.neodatis");
        }