コード例 #1
0
        public static void CommonFilterDlg_btnAccept_Handler(string name, IntPtr ptr, Form form)
        {
            CommonFilterDlg cfDlg = ((CommonFilterDlg)form);

            Assert.IsNotNull(cfDlg.Base);

            IListManager listMan = cfDlg.ListMan;

            SelectTab("tabsFilters", form, 0);

            var dataGridView1 = new DataGridViewTester("dataGridView1", form);

            dataGridView1.SelectCell(0, 0);
            dataGridView1.Properties.BeginEdit(false);
            dataGridView1.Properties.EndEdit();
            dataGridView1.SelectCell(0, 1);
            dataGridView1.Properties.BeginEdit(false);
            dataGridView1.Properties.EndEdit();
            dataGridView1.SelectCell(0, 2);
            dataGridView1.Properties.BeginEdit(false);
            dataGridView1.Properties.EndEdit();

            // Fail: AmbiguousMatch?!
            //dataGridView1.FireEvent("Scroll", new ScrollEventArgs(ScrollEventType.SmallIncrement, 1));

            if (form is PersonsFilterDlg)
            {
                PersonsFilterDlgTests.PersonsFilterDlg_Handler(form);
            }

            ClickButton("btnAccept", form);
        }
コード例 #2
0
        public void Test_SourceInput_MK_Death()
        {
            SelectTab("PageControl1", fDialog, 1);

            ClickRadioButton("rbSK_Met", fDialog);  // MK
            SelectCombo("cbEventType", fDialog, 1); // death event

            var dataGridView1 = new DataGridViewTester("dataGridView1", fDialog);

            dataGridView1.EnterCell(0, 0, fLangMan.LS(FLS.LSID_PLPerson));
            dataGridView1.EnterCell(0, 1, "Анна");
            dataGridView1.EnterCell(0, 2, "Васильевна");
            dataGridView1.EnterCell(0, 3, "Иванова");
            dataGridView1.EnterCell(0, 4, "90");
            dataGridView1.EnterCell(0, 5, "test comment");

            EnterCombo("cbSource", fDialog, "test source");
            EnterText("edSourceYear", fDialog, "1890");
            EnterText("edPage", fDialog, "12");
            EnterText("edPlace", fDialog, "Сосновка");

            ModalFormHandler = SexCheckDlgTests.SexCheckDlgTests_AcceptF_Handler; // NamesTable not available

            ClickButton("btnParse", fDialog);

            Assert.AreEqual(3, fBase.Context.Tree.RecordsCount); // newSourceRec + newIndiRec + newNoteRec

            GDMIndividualRecord iRec1 = fBase.Context.Tree.XRefIndex_Find("I1") as GDMIndividualRecord;

            Assert.IsNotNull(iRec1);
            Assert.AreEqual("Анна Васильевна Иванова", iRec1.GetPrimaryFullName());
        }
コード例 #3
0
        public void Test_SourceInput_MK_Marr()
        {
            SelectTab("PageControl1", fDialog, 1);

            ClickRadioButton("rbSK_Met", fDialog);  // MK
            SelectCombo("cbEventType", fDialog, 2); // marr event

            var dataGridView1 = new DataGridViewTester("dataGridView1", fDialog);

            dataGridView1.Properties.Rows.Add(2);
            dataGridView1.EnterCell(0, 0, fLangMan.LS(FLS.LSID_PLPerson));
            dataGridView1.EnterCell(0, 1, "Иван");
            dataGridView1.EnterCell(0, 2, "Иванович");
            dataGridView1.EnterCell(0, 3, "Иванов");
            dataGridView1.EnterCell(0, 4, "20");
            dataGridView1.EnterCell(0, 5, "test comment");
            dataGridView1.EnterCell(1, 0, fLangMan.LS(FLS.LSID_Spouse));
            dataGridView1.EnterCell(1, 1, "Анна");
            dataGridView1.EnterCell(1, 2, "Васильевна");
            dataGridView1.EnterCell(1, 3, "Иванова");
            dataGridView1.EnterCell(1, 4, "19");
            dataGridView1.EnterCell(1, 5, "test comment2");

            EnterCombo("cbSource", fDialog, "test source");
            EnterText("edSourceYear", fDialog, "1890");
            EnterText("edPage", fDialog, "12");
            EnterText("edPlace", fDialog, "Сосновка");

            ClickButton("btnParse", fDialog);

            Assert.AreEqual(6, fBase.Context.Tree.RecordsCount); // source + indi1 + note1 + family + indi2 + note2

            GDMIndividualRecord iRec1 = fBase.Context.Tree.XRefIndex_Find("I1") as GDMIndividualRecord;

            Assert.IsNotNull(iRec1);
            Assert.AreEqual("Иван Иванович Иванов", iRec1.GetPrimaryFullName());

            GDMIndividualRecord iRec2 = fBase.Context.Tree.XRefIndex_Find("I2") as GDMIndividualRecord;

            Assert.IsNotNull(iRec2);
            Assert.AreEqual("Анна Васильевна Иванова", iRec2.GetPrimaryFullName());
        }
コード例 #4
0
        public void Test_SourceInput_RS()
        {
            SelectTab("PageControl1", fDialog, 1);

            ClickRadioButton("rbSK_Rev", fDialog); // RS

            var dataGridView1 = new DataGridViewTester("dataGridView1", fDialog);

            dataGridView1.Properties.Rows.Add(5);
            dataGridView1.EnterCell(0, 0, fLangMan.LS(FLS.LSID_PLPerson));
            dataGridView1.EnterCell(0, 1, "Иван");
            dataGridView1.EnterCell(0, 2, "Иванович");
            dataGridView1.EnterCell(0, 3, "Иванов");
            dataGridView1.EnterCell(0, 4, "20");
            dataGridView1.EnterCell(0, 5, "test comment");
            dataGridView1.EnterCell(1, 0, fLangMan.LS(FLS.LSID_Spouse));
            dataGridView1.EnterCell(1, 1, "Анна");
            dataGridView1.EnterCell(1, 2, "Васильевна");
            dataGridView1.EnterCell(1, 3, "Иванова");
            dataGridView1.EnterCell(1, 4, "19");
            dataGridView1.EnterCell(1, 5, "test comment2");
            dataGridView1.EnterCell(2, 0, fLangMan.LS(FLS.LSID_Father));
            dataGridView1.EnterCell(2, 1, "Иван");
            dataGridView1.EnterCell(2, 2, "Петрович");
            dataGridView1.EnterCell(2, 3, "Иванов");
            dataGridView1.EnterCell(2, 4, "40");
            dataGridView1.EnterCell(2, 5, "");
            dataGridView1.EnterCell(3, 0, fLangMan.LS(FLS.LSID_Child));
            dataGridView1.EnterCell(3, 1, "Василий");
            dataGridView1.EnterCell(3, 2, "Иванович");
            dataGridView1.EnterCell(3, 3, "Иванов");
            dataGridView1.EnterCell(3, 4, "1");
            dataGridView1.EnterCell(3, 5, "");
            dataGridView1.EnterCell(4, 0, fLangMan.LS(FLS.LSID_PLGodparent));
            dataGridView1.EnterCell(4, 1, "Иван");
            dataGridView1.EnterCell(4, 2, "Григорьевич");
            dataGridView1.EnterCell(4, 3, "Иванов");
            dataGridView1.EnterCell(4, 4, "60");
            dataGridView1.EnterCell(4, 5, "");

            EnterCombo("cbSource", fDialog, "test source");
            EnterText("edSourceYear", fDialog, "1890");
            EnterText("edPage", fDialog, "12");
            EnterText("edPlace", fDialog, "Сосновка");

            ModalFormHandler = SexCheckDlgTests.SexCheckDlgTests_AcceptM_Handler; // NamesTable not available
            ClickButton("btnParse", fDialog);

            Assert.AreEqual(10, fBase.Context.Tree.RecordsCount);

            GDMIndividualRecord iRec1 = fBase.Context.Tree.XRefIndex_Find("I1") as GDMIndividualRecord;

            Assert.IsNotNull(iRec1);
            Assert.AreEqual("Иван Иванович Иванов", iRec1.GetPrimaryFullName());

            GDMIndividualRecord iRec2 = fBase.Context.Tree.XRefIndex_Find("I2") as GDMIndividualRecord;

            Assert.IsNotNull(iRec2);
            Assert.AreEqual("Анна Васильевна Иванова", iRec2.GetPrimaryFullName());

            GDMIndividualRecord iRec3 = fBase.Context.Tree.XRefIndex_Find("I3") as GDMIndividualRecord;

            Assert.IsNotNull(iRec3);
            Assert.AreEqual("Иван Петрович Иванов", iRec3.GetPrimaryFullName());

            GDMIndividualRecord iRec4 = fBase.Context.Tree.XRefIndex_Find("I4") as GDMIndividualRecord;

            Assert.IsNotNull(iRec4);
            Assert.AreEqual("Василий Иванович Иванов", iRec4.GetPrimaryFullName());
        }