public void Add_Contact_To_Organization_Contact_List() { ContactCreator.CreateSimpleOrphanContact(); OrganizationCreator.CreateSimpleOrganization(); OrganizationViewPage.AddContactsToContactList().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Add(); OrganizationsPage.FindOrganization().WithOrganizationName(OrganizationCreator.FirstOrganization.OrganizationName).Open(); AssertThat.IsTrue( OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact {ContactCreator.FirstContact.FullName} does not exist within organization {OrganizationCreator.FirstOrganization.OrganizationName} contacts, although it was added previously"); OrganizationViewPage.FindContactFromOrganizationContactList().BySequence(1).Remove(); AssertThat.IsFalse( OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact {ContactCreator.FirstContact.FullName} exists within organization {OrganizationCreator.FirstOrganization.OrganizationName} contacts, although it was removed previously"); ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open(); AssertThat.AreEqual(ContactViewPage.OrganizationName, "", $"Contact {ContactCreator.FirstContact.FullName} is not orphan though it should because it was removed from organization '{OrganizationCreator.FirstOrganization.OrganizationName}' contacts"); }
public void Edit_Every_Contact_Field_From_Existing_Contact() { ContactCreator.CreateContactWithAllValues(); ContactCreator.EditContactAlteringAllValues(ContactCreator.FirstContact); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should."); AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact fields have not the expected values after the edit."); }
public void Add_Existing_No_Orphan_Contact_To_An_Organization() { ContactCreator.CreateSimpleContact(); OrganizationCreator.CreateSimpleOrganization(); OrganizationViewPage.AddContactsToContactList() .UncheckingOrphanCheckbox() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Add(); AssertThat.IsTrue( OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should be linked to organization {OrganizationViewPage.OrganizationName} but it is not." ); OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open(); AssertThat.IsFalse( OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should not belong to organization {OrganizationViewPage.OrganizationName} but it is still linked with it." ); }
public void Contact_Address_Links_Navigate_To_Google_Maps() { ContactCreator.CreateContactWithAllValues(); VerifyThat.IsTrue(ContactViewPage.IsHomeAddressLinkActive, "Work address link does not navigate to google maps"); VerifyThat.IsTrue(ContactViewPage.IsOtherAddressLinkActive, "Work address link does not navigate to google maps"); VerifyThat.IsTrue(ContactViewPage.IsWorkAddressLinkActive, "Work address link does not navigate to google maps"); }
static void Main() { var app = new ApplicationService(); var training = new TrainingCreator(app); var location = new LocationCreator(app); var trainer = new TrainerCreator(app); var company = new CompanyCreator(app); var student = new StudentCreator(app); var contact = new ContactCreator(app, company); var session = new SessionCreator(app, training, trainer, location, student, company); var reader = new MsAccessReader("c:\\temp\\Database1.mdb"); var lineCount = 1; foreach (DataRow row in reader.GetRows("Formation")) { Console.Write($"Traitement de la ligne {lineCount++}\r"); training.Create(row["Formation"].ToString()); location.Create(row["Lieu"].ToString()); trainer.Create(row["Formateur"].ToString()); company.Create(row["Societe"].ToString(), row["Adresse"].ToString(), row["CP"].ToString(), row["Ville"].ToString()); student.Create(row["Stagiaire"].ToString()); contact.Create(row["Contact"].ToString(), row["Email"].ToString(), row["Telephone"].ToString(), row["Societe"].ToString()); session.Create(DateTime.Parse(row["DateFormation"].ToString()), int.Parse(row["NbJour"].ToString()), row["Formation"].ToString(), row["Formateur"].ToString(), row["Lieu"].ToString(), row["Stagiaire"].ToString(), row["Societe"].ToString()); } /* DisableAll("Formations", training.GetAll(), id => app.Command<DisableTraining>().Execute(id)); * DisableAll("Lieux", location.GetAll(), id => app.Command<DisableLocation>().Execute(id)); * DisableAll("Formateur", trainer.GetAll(), id => app.Command<DisableTrainer>().Execute(id));*/ Console.WriteLine("\r\nImport terminé !"); Console.ReadKey(); }
public void Edit_Contact_And_Delete_Organization_Value() { ContactCreator.CreateSimpleContact(); ContactCreator.EditContactRemovingOrganization(ContactCreator.FirstContact); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should."); AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact fields have not the expected values after the edit."); }
public void Can_Edit_Contact() { ContactCreator.CreateSimpleContact(); ContactCreator.EditSimpleContact(ContactCreator.FirstContact); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved successfully after edit"); AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact field values where not saved correctly after edit"); }
public void Cannot_Assign_Invalid_Organization_After_Edit() { ContactCreator.CreateSimpleContact(); ContactCreator.EditContactAssigningInvalidOrganization(ContactCreator.FirstContact); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should."); AssertThat.AreEqual(ContactViewPage.OrganizationName, "", $"Organization ought to be null but it has value = '{ContactViewPage.OrganizationName}' which is invalid. Defect spotted!"); }
public void Edit_Contact_And_Assign_Nonsense_Values() { ContactCreator.CreateSimpleContact(); ContactCreator.EditContactAssigningNonsenseValues(ContactCreator.FirstContact); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should."); AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact fields have not the expected values after the edit."); }
public void Assert_That_Page_Paths_Are_Correct() { VerifyThat.IsTrue(ContactsPage.IsAt, "Contact page path is not the expected one"); ContactsPage.OpenFirstContact(); VerifyThat.IsTrue(ContactViewPage.IsAt, "Contact view page path is not the expected one"); EditContactPage.GoTo(); VerifyThat.IsTrue(EditContactPage.IsAt, "Edit contact page path is not the expected one"); EditContactPage.ClickSaveContactButton(); VerifyThat.IsTrue(ContactViewPage.IsAt, "Contact view page path is not the expected one"); LeftSideMenu.GoToContacts(); NewContactPage.GoTo(); VerifyThat.IsTrue(NewContactPage.IsAt, "New contact page path is not the expected one"); ContactCreator.CreateSimpleContact(); OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open(); OrganizationViewPage.FindContactFromOrganizationContactList().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open(); VerifyThat.IsTrue(ContactViewPage.IsAtFromWithinOrganizationViewPage, "Contact view page path from within organization view page is not the expected one"); EditContactPage.GoTo(); VerifyThat.IsTrue(EditContactPage.IsAtFromWithinOrganizationViewPage, "Edit contact page path from within organization view page is not the expected one"); EditContactPage.ClickSaveContactButton(); VerifyThat.IsTrue(ContactViewPage.IsAtFromWithinOrganizationViewPage, "Contact view page path from within organization view page is not the expected one"); OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open(); OrganizationViewPage.CreateContact(); VerifyThat.IsTrue(NewContactPage.IsAtFromWithinOrganizationViewPage, "Contact view page path from within organization view page is not the expected one"); }
public void Organization_Name_Navigates_To_Organization_View() { ContactCreator.CreateSimpleContact(); ContactViewPage.ClickOrganizationName(); AssertThat.AreEqual(ContactCreator.FirstContact.OrganizationName, OrganizationViewPage.OrganizationName, $"Browser should navigate to '{ContactCreator.FirstContact.OrganizationName}' organization view but, it did not"); }
public void Contact_Emails_Are_Emailable() { ContactCreator.CreateContactWithAllValues(); VerifyThat.IsTrue(ContactViewPage.IsWorkEmailEmailable, "Work email link is not active but it should"); VerifyThat.IsTrue(ContactViewPage.IsPersonalEmailEmailable, "Personal email link is not active but it should"); VerifyThat.IsTrue(ContactViewPage.IsOtherEmailEmailable, "Other email link is not active but it should"); }
public void Create_Contact_With_Extra_Null_Fields() { ContactCreator.CreateContactWithNullValuesInExtraFields(); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactCreatedSuccessfully, "Contact was not created successfully though it should. Defect spotted!"); AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact field values were not saved correctly"); }
public void Cannot_Assign_Invalid_Organization_Field_Value() { ContactCreator.CreateContactWithInvalidOrganization(); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactCreatedSuccessfully, "Contact was not created successfully though it should. Defect spotted!"); AssertThat.AreEqual(ContactViewPage.OrganizationName, "", $"Organization ought to be null but it has value = '{ContactViewPage.OrganizationName}' which is invalid. Defect spotted!"); }
public void Create_Contact_With_Nonsense_Field_Values() { ContactCreator.CreateContactWithNonsenseValues(); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactCreatedSuccessfully, "Contact was not saved successfully but it should."); AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact field values were not saved correctly"); }
public void Duplicate_Contact_Indicator() { ContactCreator.CreateSimpleContact(); LeftSideMenu.GoToContacts(); NewContactPage.GoTo(); NewContactPage.SetFirstName(ContactCreator.FirstContact.FirstName); NewContactPage.SetLastName(ContactCreator.FirstContact.LastName); AssertThat.IsTrue(NewContactPage.IsPossibleDuplicateAlertShown, "There should be an alert at the top of the page that informs for the possibility of a duplicate contact"); }
public void Edit_Contact_From_Within_Organization_Contact_List() { ContactCreator.CreateSimpleContact(); OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open(); OrganizationViewPage.FindContactFromOrganizationContactList().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open(); ContactCreator.EditSimpleContactWithOrganization(ContactCreator.FirstContact); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should."); AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact fields have not the expected values after the edit."); }
public void Import_Contact_That_Already_Exists() { ContactCreator.ImportOutlookCsvContactsThatAlreadyExists(); AssertThat.IsTrue(ContactCreator.IsContactFileImportedWithDuplicates, "Contact was imported successfully but it does not contain value for last name field"); ContactsPage.FindContact() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(); AssertThat.AreEqual(ContactsPage.TotalContactsCountByLabel, 1, $"There should be only one contact with name '{ContactCreator.FirstContact.FullName}' being displayed. It seems that the second twin contact was imported successfully"); }
public void Contact_Telephone_Numbers_Are_Callable() { ContactCreator.CreateContactWithAllValues(); VerifyThat.IsTrue(ContactViewPage.IsMobilePhoneCallable, "Contact mobile phone is not callable but it should"); VerifyThat.IsTrue(ContactViewPage.IsMobilePhone2Callable, "Contact mobile phone 2 is not callable but it should"); VerifyThat.IsTrue(ContactViewPage.IsWorkPhoneCallable, "Contact work phone is not callable but it should"); VerifyThat.IsTrue(ContactViewPage.IsWorkPhone2Callable, "Contact work phone 2 is not callable but it should"); VerifyThat.IsTrue(ContactViewPage.IsHomePhoneCallable, "Contact home phone is not callable but it should"); VerifyThat.IsTrue(ContactViewPage.IsHomePhone2Callable, "Contact home phone is not callable but it should"); VerifyThat.IsTrue(ContactViewPage.IsOtherPhoneCallable, "Contact other phone is not callable but it should"); }
/// <summary> /// Method used to add a contact by absolute position /// </summary> /// <param name="position">Absolute position of contact <see cref="PointF"/></param> /// <param name="contactType">Contact type to create <see cref="ContactTypes"/></param> /// <param name="heading"></param> /// <param name="speed"></param> /// <param name="altitude"></param> /// <returns></returns> protected IReferencePoint CreateContactAtPoint(PointF position, ContactTypes contactType, double heading = 0.00, double speed = 0.00, double altitude = 0.00) { var contactFactory = new ContactCreator(); var newContact = contactFactory.Create(RadarReceiver, position, heading, altitude, speed, contactType); Logger.Info($"Creating contact: {contactType} as a plotted contact at {position}"); newContact.ReferencePointChanged += NewContact_ReferencePointChanged; RadarReceiver.AddContact(newContact); newContact.Start(); return(newContact); }
public void Import_Contact_That_Already_Exist_Within_Contacts() { ContactCreator.ImportTemplateWithAnExistingContact(); AssertThat.IsTrue(ContactCreator.IsContactFileImportedWithDuplicates, "At least one of the 2 duplicate contacts should have been imported but neither did."); ContactsPage.FindContact() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(); AssertThat.AreEqual(ContactsPage.TotalContactsCountByLabel, 1, $"There should be only one contact with name '{ContactCreator.FirstContact.FullName}' being displayed. It seems that the second twin contact was imported successfully"); }
public static void CreateContact(SqlString contactData, out SqlInt32 contactId, out SqlInt32 customerId) { //TODO: When we can pass XML from T-SQL then contactData can be a SqlXmlReader using (StringReader sr = new StringReader(contactData.Value)) { XmlReader reader = XmlReader.Create(sr); ContactCreator creator = null; try { reader.MoveToContent(); EnsureEqual(reader.LocalName, "Contact"); reader.MoveToContent(); reader.ReadStartElement(); switch (reader.LocalName) { case "Individual": creator = new IndividualCreator(); break; case "Store": creator = new StoreCreator(); break; case "Vendor": creator = new VendorCreator(); break; case "Employee": creator = new EmployeeCreator(); break; default: break; } if (creator != null) { reader.ReadStartElement(); reader.MoveToContent(); creator.LoadDictionary(reader); creator.Create(); contactId = creator.ContactId; customerId = creator.CustomerId; } else { contactId = -1; customerId = -1; throw new AWUtilitiesContactParseException( "Individual | Store | Vendor | Employee", reader.LocalName); } } finally { reader.Close(); } } }
public void Import_Contacts_With_Invalid_Birthdate_Values() { ContactCreator.ImportTemplateContactWithInvalidBirthdate(); AssertThat.IsTrue(ContactCreator.IsContactFileImportedSuccessfully, "Contact were not imported but they should."); ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open(); VerifyThat.AreEqual(ContactViewPage.Birthdate, "", $"Contact birthdate should be empty because imported contact's birthdate value is {ContactCreator.FirstContact.Birthdate} which is invalid."); ContactsPage.FindContact().WithFirstName(ContactCreator.SecondContact.FirstName).AndLastName(ContactCreator.SecondContact.LastName).Open(); VerifyThat.AreEqual(ContactViewPage.Birthdate, "", $"Contact birthdate should be empty because imported contact's birthdate value is {ContactCreator.SecondContact.Birthdate} which is invalid."); ContactsPage.FindContact().WithFirstName(ContactCreator.ThirdContact.FirstName).AndLastName(ContactCreator.ThirdContact.LastName).Open(); VerifyThat.AreEqual(ContactViewPage.Birthdate, "", $"Contact birthdate should be empty because imported contact's birthdate value is {ContactCreator.ThirdContact.Birthdate} which is invalid."); }
public void Create_Contact_From_Within_Organization() { LeftSideMenu.GoToOrganizations(); OrganizationsPage.OpenFirstOrganization(); ContactCreator.CreateSimpleContactFromWithinOrganization(); AssertThat.IsTrue(ContactCreator.FirstContact.IsContactCreatedSuccessfully, "Contact was not saved successfully but it should."); OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Open(); AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact field values were not saved correctly"); }
public void Remove_Contact_From_Organization_Contact_List() { ContactCreator.CreateSimpleContact(); OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open(); OrganizationViewPage.FindContactFromOrganizationContactList().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Remove(); OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open(); AssertThat.IsFalse( OrganizationViewPage. FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact {ContactCreator.FirstContact.FullName} was supposed to be removed but is still a contact of organization {ContactCreator.FirstContact.OrganizationName}." ); }
public void Make_A_Contact_Favorite() { ContactCreator.CreateSimpleContact(); ContactViewPage.SetContactFavorite(false); AssertThat.IsFalse(ContactViewPage.IsContactFavorite, "Contact should have been set as un-favorite, but it is still favorite"); LeftSideMenu.GoToContacts(); ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).CheckFavorite(); ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open(); AssertThat.IsTrue(ContactViewPage.IsContactFavorite, "Contact should have been set as favorite, but it is still un-favorite"); ContactViewPage.SetContactFavorite(false); LeftSideMenu.GoToContacts(); ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open(); AssertThat.IsFalse(ContactViewPage.IsContactFavorite, "Contact should have been set as favorite, but it is still un-favorite"); }
public virtual void Send(IModelSend senderModel) { if (CurrentRecieveStatus == EControllerStatus.Processing) { return; } var contact = ContactCreator.CreateContact(senderModel); contact.Reciever = this; var processingModel = new DataModelMock { ControllerStatus = EControllerStatus.Processing }; CurrentRecieveStatus = processingModel.ControllerStatus; OnRecieveModel?.Invoke(processingModel); contact.Sender.Send(senderModel); }
public void Delete_Organization_Along_With_Its_Linked_Contacts() { ContactCreator.CreateSimpleOrphanContact(); ContactCreator.CreateSimpleOrphanContact(); ContactCreator.CreateSimpleOrphanContact(); OrganizationCreator.CreateSimpleOrganization(); OrganizationViewPage.AddContactsToContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Add(); OrganizationViewPage.AddContactsToContactList() .WithFirstName(ContactCreator.SecondContact.FirstName) .AndLastName(ContactCreator.SecondContact.LastName) .Add(); OrganizationViewPage.AddContactsToContactList() .WithFirstName(ContactCreator.ThirdContact.FirstName) .AndLastName(ContactCreator.ThirdContact.LastName) .Add(); OrganizationViewPage.DeleteOrganization().WithContacts(); VerifyThat.IsFalse( OrganizationsPage.FindOrganization().WithOrganizationName(OrganizationCreator.FirstOrganization.OrganizationName).Find(), $"Organization with name {OrganizationCreator.FirstOrganization.OrganizationName} should be deleted but, it still exists" ); VerifyThat.IsFalse( ContactsPage.FindContact().ContainingKeyword(ContactCreator.FirstContact.FullName).Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should be deleted along with its organization but, it still exists" ); VerifyThat.IsFalse( ContactsPage.FindContact().ContainingKeyword(ContactCreator.SecondContact.FullName).Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should be deleted along with its organization but, it still exists" ); VerifyThat.IsFalse( ContactsPage.FindContact().ContainingKeyword(ContactCreator.ThirdContact.FullName).Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should be deleted along with its organization but, it still exists" ); }
public void SaveAndLoadTest() { var builders = new ContactBuilder[3] { new ContactBuilder(), new ContactBuilder(), new ContactBuilder() }; using (var creator = new ContactCreator()) { builders[0].SetFirstName("Brian").SetLastName("Rothwell").SetContactInfo("*****@*****.**"); builders[1].SetFirstName("Billy").SetLastName("Bob").SetContactInfo("*****@*****.**"); builders[2].SetFirstName("Jenny").SetLastName("Twotone").SetContactInfo("(210) 867-5308"); foreach (var builder in builders) { builder.SetCreator(creator); var contact = (Contact)builder.Build(); builder.SetObjectId(contact.GetObjectId()); Helper.AssertAreEqual(builder, contact, "Original"); } creator.Save(); } using (var creator = new ContactCreator()) // Re-open the files. { foreach (var builder in builders) { var objectId = builder.GetObjectId(); var savedContact = (Contact)creator.Create(objectId); Helper.AssertAreEqual(builder, savedContact, "Saved"); } } }
public void CleanUp() => ContactCreator.CleanUp();