Exemplo n.º 1
0
        private void FillInFixture()
        {
            PwGroup rootGroup = m_database.RootGroup;

            m_treeManager.CreateNewUser("mrX");
            m_treeManager.CreateNewUser("mrY");
            m_standardKey = SyncSource.CreateKeyFor(STANDARD_PASSWORD);

            PwEntry mrX = TestHelper.GetUserRootNodeByNameFor(m_database, "mrX");
            PwEntry mrY = TestHelper.GetUserRootNodeByNameFor(m_database, "mrY");

            mrX.SetPassword(STANDARD_PASSWORD);
            mrY.SetPassword(STANDARD_PASSWORD);
            PwGroup mrXhome = m_database.GetUsersGroup().Groups.GetAt(0);

            //normal entries
            PwEntry normalEntry1 = new PwEntry(true, false);

            normalEntry1.SetTitle("normalEntry1");
            Uuid1 = normalEntry1.Uuid;
            PwEntry normalEntry2 = new PwEntry(true, false);

            normalEntry2.SetTitle("normalEntry2");
            Uuid2 = normalEntry2.Uuid;
            PwEntry normalEntry3 = new PwEntry(true, false);

            normalEntry3.SetTitle("normalEntry3");
            Uuid3 = normalEntry3.Uuid;
            PwEntry normalEntry4 = new PwEntry(true, false);

            normalEntry4.SetTitle("normalEntry4");
            Uuid4 = normalEntry4.Uuid;
            PwEntry normalEntry5 = new PwEntry(true, false);

            normalEntry5.SetTitle("normalEntry5");
            Uuid5 = normalEntry5.Uuid;
            PwEntry normalEntry6 = new PwEntry(true, false);

            normalEntry6.SetTitle("normalEntry6");
            Uuid6 = normalEntry6.Uuid;

            //pwdProxies
            PwEntry pwdProxyTo1 = normalEntry1.CreateProxyNode();
            PwEntry pwdProxyTo3 = normalEntry3.CreateProxyNode();

            //userProxies
            PwEntry userProxyToMrX = mrX.CreateProxyNode();

            PwGroup grp1 = new PwGroup(true, true, "grp1", PwIcon.BlackBerry);

            rootGroup.AddEntry(normalEntry1, true);
            rootGroup.AddEntry(normalEntry2, true);
            rootGroup.AddEntry(normalEntry3, true);
            rootGroup.AddGroup(grp1, true);

            grp1.AddEntry(normalEntry4, true);
            grp1.AddEntry(normalEntry5, true);
            grp1.AddEntry(userProxyToMrX, true);
            grp1.AddEntry(pwdProxyTo1, true);

            mrXhome.AddEntry(normalEntry6, true);
            mrXhome.AddEntry(pwdProxyTo3, true);
            Assert.AreEqual(13, rootGroup.GetEntries(true).UCount);
        }