public static void EventEditDlg_Select_Handler(string name, IntPtr ptr, Form form) { EventEditDlg eventDlg = (EventEditDlg)form; Assert.IsNotNull(eventDlg.Event); SelectCombo("cmbEventType", form, 1); // Birth(indi) / ?(fam) EnterText("txtEventPlace", form, "test place"); SelectCombo("cmbEventDateType", form, 3); // Between EnterMaskedText("txtEventDate1", form, "01.01.1900"); EnterMaskedText("txtEventDate2", form, "10.01.1900"); SelectCombo("cmbDate1Calendar", form, 1); // Julian SelectCombo("cmbDate2Calendar", form, 1); // Julian EnterText("txtEventCause", form, "test cause"); EnterText("txtEventOrg", form, "test agency"); SetModalFormHandler(fFormTest, AddressEditDlgTests.AddressEditDlg_btnAccept_Handler); ClickButton("btnAddress", form); RecordSelectDlgTests.SetCreateItemHandler(fFormTest, LocationEditDlgTests.LocationAdd_Mini_Handler); ClickButton("btnPlaceAdd", form); ClickButton("btnPlaceDelete", form); ClickButton("btnAccept", form); }
public static void ResearchEditDlg_Handler(ResearchEditDlg dlg) { GDMResearchRecord resRecord = dlg.Research; // tasks SelectTab("tabsData", dlg, 0); Assert.AreEqual(0, resRecord.Tasks.Count); RecordSelectDlgTests.SetCreateItemHandler(fFormTest, TaskEditDlgTests.TaskAdd_Mini_Handler); ClickToolStripButton("fTasksList_ToolBar_btnAdd", dlg); Assert.AreEqual(1, resRecord.Tasks.Count); SelectSheetListItem("fTasksList", dlg, 0); SetModalFormHandler(fFormTest, TaskEditDlgTests.TaskAdd_Mini_Handler); ClickToolStripButton("fTasksList_ToolBar_btnEdit", dlg); Assert.AreEqual(1, resRecord.Tasks.Count); SelectSheetListItem("fTasksList", dlg, 0); SetModalFormHandler(fFormTest, MessageBox_YesHandler); ClickToolStripButton("fTasksList_ToolBar_btnDelete", dlg); Assert.AreEqual(0, resRecord.Tasks.Count); // communications SelectTab("tabsData", dlg, 1); Assert.AreEqual(0, resRecord.Communications.Count); RecordSelectDlgTests.SetCreateItemHandler(fFormTest, CommunicationEditDlgTests.CommunicationAdd_Mini_Handler); ClickToolStripButton("fCommunicationsList_ToolBar_btnAdd", dlg); Assert.AreEqual(1, resRecord.Communications.Count); SelectSheetListItem("fCommunicationsList", dlg, 0); SetModalFormHandler(fFormTest, CommunicationEditDlgTests.CommunicationAdd_Mini_Handler); ClickToolStripButton("fCommunicationsList_ToolBar_btnEdit", dlg); Assert.AreEqual(1, resRecord.Communications.Count); SelectSheetListItem("fCommunicationsList", dlg, 0); SetModalFormHandler(fFormTest, MessageBox_YesHandler); ClickToolStripButton("fCommunicationsList_ToolBar_btnDelete", dlg); Assert.AreEqual(0, resRecord.Communications.Count); // groups SelectTab("tabsData", dlg, 2); Assert.AreEqual(0, resRecord.Groups.Count); RecordSelectDlgTests.SetCreateItemHandler(fFormTest, GroupEditDlgTests.GroupAdd_Mini_Handler); ClickToolStripButton("fGroupsList_ToolBar_btnAdd", dlg); Assert.AreEqual(1, resRecord.Groups.Count); Assert.AreEqual("sample group", ((GDMGroupRecord)resRecord.Groups[0].Value).GroupName); SelectSheetListItem("fGroupsList", dlg, 0); SetModalFormHandler(fFormTest, GroupEditDlgTests.GroupAdd_Mini_Handler); ClickToolStripButton("fGroupsList_ToolBar_btnEdit", dlg); Assert.AreEqual(1, resRecord.Groups.Count); SelectSheetListItem("fGroupsList", dlg, 0); SetModalFormHandler(fFormTest, MessageBox_YesHandler); ClickToolStripButton("fGroupsList_ToolBar_btnDelete", dlg); Assert.AreEqual(0, resRecord.Groups.Count); ClickButton("btnAccept", dlg); }
public static void SourceEditDlg_Handler(SourceEditDlg dlg) { GDMSourceRecord srcRecord = dlg.Model; SelectTab("tabsData", dlg, 2); // repositories Assert.AreEqual(0, srcRecord.RepositoryCitations.Count); RecordSelectDlgTests.SetCreateItemHandler(fFormTest, TaskEditDlgTests.TaskAdd_Mini_Handler); ClickToolStripButton("fRepositoriesList_ToolBar_btnAdd", dlg); Assert.AreEqual(1, srcRecord.RepositoryCitations.Count); SelectSheetListItem("fRepositoriesList", dlg, 0); SetModalFormHandler(fFormTest, MessageBox_YesHandler); ClickToolStripButton("fRepositoriesList_ToolBar_btnDelete", dlg); Assert.AreEqual(0, srcRecord.RepositoryCitations.Count); ClickButton("btnAccept", dlg); }
public static void TaskEditDlg_Handler(TaskEditDlg dlg) { SelectCombo("cmbGoalType", dlg, 3); ClickButton("btnGoalSelect", dlg); SelectCombo("cmbGoalType", dlg, 2); RecordSelectDlgTests.SetCreateItemHandler(fFormTest, SourceEditDlgTests.SourceAdd_Mini_Handler); ClickButton("btnGoalSelect", dlg); SelectCombo("cmbGoalType", dlg, 1); RecordSelectDlgTests.SetCreateItemHandler(fFormTest, FamilyEditDlgTests.FamilyAdd_Mini_Handler); ClickButton("btnGoalSelect", dlg); SelectCombo("cmbGoalType", dlg, 0); PersonEditDlgTests.SetCreateIndividualHandler(fFormTest, GDMSex.svMale); ClickButton("btnGoalSelect", dlg); ClickButton("btnAccept", dlg); }
public static void SetCreateIndividualHandler(NUnitFormTest formTest, GDMSex needIndividualSex) { fNeedIndividualSex = needIndividualSex; RecordSelectDlgTests.SetCreateItemHandler(formTest, IndividualAdd_Mini_Handler); }
private void PersonEditDlg_Handler(PersonEditDlg dlg) { GDMIndividualRecord indiRecord = dlg.Person; SelectCombo("cmbSex", dlg, 1); // male var tabs = new TabControlTester("tabsPersonData", dlg); var cmbRestriction = new ComboBoxTester("cmbRestriction", dlg); cmbRestriction.Select(3); cmbRestriction.Select(2); cmbRestriction.Select(1); cmbRestriction.Select(0); var txtSurname = new TextBoxTester("txtSurname", dlg); txtSurname.FireEvent("KeyDown", new KeyEventArgs(Keys.Down | Keys.Control)); // parents RecordSelectDlgTests.SetCreateItemHandler(this, FamilyEditDlgTests.FamilyAdd_Mini_Handler); ClickButton("btnParentsAdd", dlg); ModalFormHandler = MessageBox_YesHandler; ClickButton("btnParentsDelete", dlg); // father PersonEditDlgTests.SetCreateIndividualHandler(this, GDMSex.svMale); ClickButton("btnFatherAdd", dlg); ModalFormHandler = MessageBox_YesHandler; ClickButton("btnFatherDelete", dlg); // mother PersonEditDlgTests.SetCreateIndividualHandler(this, GDMSex.svFemale); ClickButton("btnMotherAdd", dlg); ModalFormHandler = MessageBox_YesHandler; ClickButton("btnMotherDelete", dlg); ClickButton("btnNameCopy", dlg); // events tabs.SelectTab(0); Assert.AreEqual(1, indiRecord.Events.Count); SetModalFormHandler(this, EventEditDlgTests.EventEditDlg_Select_Handler); ClickToolStripButton("fEventsList_ToolBar_btnAdd", dlg); Assert.AreEqual(2, indiRecord.Events.Count); SelectSheetListItem("fEventsList", dlg, 1); SetModalFormHandler(this, EventEditDlgTests.EventEditDlg_Select_Handler); ClickToolStripButton("fEventsList_ToolBar_btnEdit", dlg); Assert.AreEqual(2, indiRecord.Events.Count); ModalFormHandler = MessageBox_YesHandler; SelectSheetListItem("fEventsList", dlg, 1); ClickToolStripButton("fEventsList_ToolBar_btnDelete", dlg); Assert.AreEqual(1, indiRecord.Events.Count); // spouses tabs.SelectTab(1); Assert.AreEqual(0, indiRecord.SpouseToFamilyLinks.Count); ModalFormHandler = FamilyEditDlgTests.SpouseEdit_Handler; ClickToolStripButton("fSpousesList_ToolBar_btnAdd", dlg); Assert.AreEqual(1, indiRecord.SpouseToFamilyLinks.Count); SelectSheetListItem("fSpousesList", dlg, 1); ModalFormHandler = FamilyEditDlgTests.SpouseEdit_Handler; ClickToolStripButton("fSpousesList_ToolBar_btnEdit", dlg); Assert.AreEqual(1, indiRecord.SpouseToFamilyLinks.Count); SelectSheetListItem("fSpousesList", dlg, 1); ModalFormHandler = MessageBox_YesHandler; ClickToolStripButton("fSpousesList_ToolBar_btnDelete", dlg); Assert.AreEqual(0, indiRecord.SpouseToFamilyLinks.Count); // names tabs.SelectTab(2); Assert.AreEqual(1, indiRecord.PersonalNames.Count); ModalFormHandler = PersonalNameEditDlgTests.NameEditAdd_Handler; ClickToolStripButton("fNamesList_ToolBar_btnAdd", dlg); Assert.AreEqual(2, indiRecord.PersonalNames.Count); Assert.AreEqual("sample surname", indiRecord.PersonalNames[1].Surname); SelectSheetListItem("fNamesList", dlg, 1); ModalFormHandler = PersonalNameEditDlgTests.NameEditEdit_Handler; ClickToolStripButton("fNamesList_ToolBar_btnEdit", dlg); Assert.AreEqual(2, indiRecord.PersonalNames.Count); Assert.AreEqual("sample surname2", indiRecord.PersonalNames[1].Surname); SelectSheetListItem("fNamesList", dlg, 1); ModalFormHandler = MessageBox_YesHandler; ClickToolStripButton("fNamesList_ToolBar_btnDelete", dlg); Assert.AreEqual(1, indiRecord.PersonalNames.Count); // associations tabs.SelectTab(3); Assert.AreEqual(0, indiRecord.Associations.Count); ModalFormHandler = AssociationEditDlgTests.AcceptModalHandler; ClickToolStripButton("fAssociationsList_ToolBar_btnAdd", dlg); Assert.AreEqual(1, indiRecord.Associations.Count); Assert.AreEqual("sample relation", indiRecord.Associations[0].Relation); ModalFormHandler = MessageBox_YesHandler; SelectSheetListItem("fAssociationsList", dlg, 0); ClickToolStripButton("fAssociationsList_ToolBar_btnDelete", dlg); Assert.AreEqual(0, indiRecord.Associations.Count); // groups tabs.SelectTab(4); Assert.AreEqual(0, indiRecord.Groups.Count); RecordSelectDlgTests.SetCreateItemHandler(this, GroupEditDlgTests.GroupAdd_Mini_Handler); ClickToolStripButton("fGroupsList_ToolBar_btnAdd", dlg); Assert.AreEqual(1, indiRecord.Groups.Count); Assert.AreEqual("sample group", fCurBase.Context.Tree.GetPtrValue <GDMGroupRecord>(indiRecord.Groups[0]).GroupName); ModalFormHandler = MessageBox_YesHandler; SelectSheetListItem("fGroupsList", dlg, 0); ClickToolStripButton("fGroupsList_ToolBar_btnDelete", dlg); Assert.AreEqual(0, indiRecord.Groups.Count); StructsDlg_Handler(indiRecord, dlg, tabs, new int[] { 5, 6, 7 }); // userrefs tabs.SelectTab(8); Assert.AreEqual(0, indiRecord.UserReferences.Count); ModalFormHandler = UserRefEditDlgTests.AcceptHandler; ClickToolStripButton("fUserRefList_ToolBar_btnAdd", dlg); Assert.AreEqual(1, indiRecord.UserReferences.Count); Assert.AreEqual("sample reference", indiRecord.UserReferences[0].StringValue); ModalFormHandler = MessageBox_YesHandler; SelectSheetListItem("fUserRefList", dlg, 0); ClickToolStripButton("fUserRefList_ToolBar_btnDelete", dlg); Assert.AreEqual(0, indiRecord.UserReferences.Count); ClickButton("btnAccept", dlg); }