Exemplo n.º 1
0
        public void Bug2Test()
        {
            using (SessionNoServer session = new SessionNoServer(systemDir))
            {
                const ushort nodeMaxSize                  = 5000;
                const ushort comparisonByteArraySize      = sizeof(Int32); // enough room to hold entire idNumber of a Person
                const bool   comparisonArrayIsCompleteKey = true;
                const bool   addIdCompareIfEqual          = false;
                session.BeginUpdate();
                //mySession.SetTraceAllDbActivity();
                CompareByField <Entity> compareByField = new CompareByField <Entity>("idNumber", session, addIdCompareIfEqual);
                BTreeSet <Entity>       bTree          = new BTreeSet <Entity>(compareByField, session, nodeMaxSize, comparisonByteArraySize, comparisonArrayIsCompleteKey);
                Placement place = new Placement(40);
                bTree.Persist(place, session);
                for (int i = 0; i < 5; i++)
                {
                    var x = new Entity();
                    x.idNumber   = 250000;
                    x.UserID     = 100116;
                    x.FirstName  = "Bill";
                    x.LastName   = "Martin";
                    x.MiddleName = "Bob";

                    if (!bTree.Contains(x))
                    {
                        x.Persist(place, session);
                        bTree.Add(x);
                    }
                }
                Assert.IsTrue(bTree.Count == 1);
                session.Commit();
            }
        }
Exemplo n.º 2
0
 public bool RelationExist(Relation <Folder, Folder> relation)
 {
     return(m_folders.Contains(relation.RelationFrom));
 }
Exemplo n.º 3
0
 public bool RelationExist(Relation <FileInDb, Folder> relation)
 {
     return(m_files.Contains(relation.RelationFrom));
 }