public void Create() { var before = new PartyRelationships(this.Session).Extent().ToArray(); var person = new People(this.Session).Extent().First; this.personListPage.Table.DefaultAction(person); var customerRelationshipEdit = new PersonOverviewComponent(this.personListPage.Driver).PartyrelationshipOverviewPanel.Click().CreateCustomerRelationship(); customerRelationshipEdit .FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PartyRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var partyRelationship = after.Except(before).First(); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); }
public void Create() { var before = new OrganisationContactRelationships(this.Session).Extent().ToArray(); this.organisations.Table.DefaultAction(this.organisation); var partyRelationshipEdit = new OrganisationOverviewComponent(this.organisations.Driver).PartyrelationshipOverviewPanel.Click().CreateOrganisationContactRelationship(); partyRelationshipEdit .FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .ContactKinds.Toggle(new OrganisationContactKinds(this.Session).SalesContact) .Contact.Select(this.contact.DisplayName()) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new OrganisationContactRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var partyRelationship = after.Except(before).First(); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); Assert.Equal(2, partyRelationship.ContactKinds.Count); Assert.Contains(new OrganisationContactKinds(this.Session).GeneralContact, partyRelationship.ContactKinds); Assert.Contains(new OrganisationContactKinds(this.Session).SalesContact, partyRelationship.ContactKinds); Assert.Equal(this.organisation, partyRelationship.Organisation); Assert.Equal(this.contact, partyRelationship.Contact); }
public void Edit() { var before = new PartyRelationships(this.Session).Extent().ToArray(); var extent = new Organisations(this.Session).Extent(); var internalOrganisation = extent.First(v => v.DisplayName().Equals("Allors BVBA")); this.organisations.Table.DefaultAction(internalOrganisation); var organisationOverviewPage = new OrganisationOverviewComponent(this.organisations.Driver); var partyRelationshipOverview = organisationOverviewPage.PartyrelationshipOverviewPanel.Click(); partyRelationshipOverview.Table.DefaultAction(this.editPartyRelationship); var partyRelationshipEdit = new SupplierRelationshipEditComponent(organisationOverviewPage.Driver); partyRelationshipEdit .FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PartyRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); }
public void Edit() { var before = new Employments(this.Session).Extent().ToArray(); var employer = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var personOverviewPage = this.people.Select(this.employee); var page = personOverviewPage.SelectPartyRelationship(this.editPartyRelationship); page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new Employments(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); Assert.Equal(employer, this.editPartyRelationship.Employer); Assert.Equal(this.employee, this.editPartyRelationship.Employee); }
public void Edit() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var people = new People(this.Session).Extent(); var person = people.First(v => v.PartyName.Equals("John0 Doe0")); var editPartyRelationship = new CustomerRelationshipBuilder(this.Session) .WithCustomer(person) .WithInternalOrganisation(allors) .Build(); this.Session.Derive(); this.Session.Commit(); var before = new PartyRelationships(this.Session).Extent().ToArray(); var personOverview = this.personListPage.Select(person); var page = personOverview.SelectPartyRelationship(editPartyRelationship); page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PartyRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); }
public void Create() { var before = new OrganisationContactRelationships(this.Session).Extent().ToArray(); var personOverviewPage = this.people.Select(this.contact); var page = personOverviewPage.NewOrganisationContactRelationship(); page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .ContactKinds.Toggle(new OrganisationContactKinds(this.Session).SalesContact.Description) .Organisation.Set(this.organisation.PartyName) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new OrganisationContactRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var partyRelationship = after.Except(before).First(); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); Assert.Equal(2, partyRelationship.ContactKinds.Count); Assert.Contains(new OrganisationContactKinds(this.Session).GeneralContact, partyRelationship.ContactKinds); Assert.Contains(new OrganisationContactKinds(this.Session).SalesContact, partyRelationship.ContactKinds); Assert.Equal(this.organisation, partyRelationship.Organisation); Assert.Equal(this.contact, partyRelationship.Contact); }
public void Create() { var before = new PartyRelationships(this.Session).Extent().ToArray(); var people = new People(this.Session).Extent(); var person = people.First(v => v.PartyName.Equals("John0 Doe0")); var page = this.personListPage.Select(person).NewCustomerRelationship(); page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PartyRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var partyRelationship = after.Except(before).First(); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); }
public void Edit() { var before = new OrganisationContactRelationships(this.Session).Extent().ToArray(); this.people.Table.DefaultAction(this.contact); var personOverviewPage = new PersonOverviewComponent(this.people.Driver); var partyRelationshipOverview = personOverviewPage.PartyrelationshipOverviewPanel.Click(); partyRelationshipOverview.Table.DefaultAction(this.editPartyRelationship); var organisationContactRelationshipEditComponent = new OrganisationContactRelationshipEditComponent(this.Driver); organisationContactRelationshipEditComponent.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .ContactKinds.Toggle(new OrganisationContactKinds(this.Session).GeneralContact) .ContactKinds.Toggle(new OrganisationContactKinds(this.Session).SalesContact) .ContactKinds.Toggle(new OrganisationContactKinds(this.Session).SupplierContact) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new OrganisationContactRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); Assert.Equal(2, this.editPartyRelationship.ContactKinds.Count); Assert.Contains(new OrganisationContactKinds(this.Session).SalesContact, this.editPartyRelationship.ContactKinds); Assert.Contains(new OrganisationContactKinds(this.Session).SupplierContact, this.editPartyRelationship.ContactKinds); Assert.Equal(this.organisation, this.editPartyRelationship.Organisation); Assert.Equal(this.contact, this.editPartyRelationship.Contact); }
public void Create() { var before = new PartyRelationships(this.Session).Extent().ToArray(); var extent = new Organisations(this.Session).Extent(); var internalOrganisation = extent.First(v => v.PartyName.Equals("Allors BVBA")); var organisationOverviewPage = this.organisations.Select(internalOrganisation); var page = organisationOverviewPage.NewCustomerRelationship(); page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PartyRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var partyRelationship = after.Except(before).First(); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); }
public void Create() { var before = new Employments(this.Session).Extent().ToArray(); var employer = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); this.people.Table.DefaultAction(this.employee); var employmentEditComponent = new PersonOverviewComponent(this.people.Driver).PartyrelationshipOverviewPanel.Click().CreateEmployment(); employmentEditComponent.FromDate .Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new Employments(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var partyRelationship = after.Except(before).First(); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); Assert.Equal(employer, partyRelationship.Employer); Assert.Equal(this.employee, partyRelationship.Employee); }
public void Create() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First(); var organisation = allors.ActiveCustomers.First(v => v.GetType().Name == typeof(Organisation).Name); var organisationAddress = new PostalAddressBuilder(this.Session) .WithAddress1("Haverwerf 15") .WithLocality("city") .WithPostalCode("1111") .WithCountry(new Countries(this.Session).FindBy(M.Country.IsoCode, "BE")) .Build(); organisation.AddPartyContactMechanism(new PartyContactMechanismBuilder(this.Session).WithContactMechanism(organisationAddress).Build()); this.Session.Derive(); this.Session.Commit(); var before = new LetterCorrespondences(this.Session).Extent().ToArray(); this.organisationListPage.Table.DefaultAction(organisation); var letterCorrespondenceEdit = new OrganisationOverviewComponent(this.organisationListPage.Driver).CommunicationeventOverviewPanel.Click().CreateLetterCorrespondence(); letterCorrespondenceEdit .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment) .FromParty.Select(organisation) .ToParty.Select(employee) .FromPostalAddress.Select(organisationAddress) .Subject.Set("subject"); letterCorrespondenceEdit.ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22)); letterCorrespondenceEdit.ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22)); letterCorrespondenceEdit.ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)); letterCorrespondenceEdit.ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)); letterCorrespondenceEdit.Comment.Set("comment"); letterCorrespondenceEdit.SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new LetterCorrespondences(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var communicationEvent = after.Except(before).First(); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Appointment, communicationEvent.EventPurposes); Assert.Equal(organisationAddress, communicationEvent.PostalAddress); Assert.Equal(organisation, communicationEvent.FromParty); Assert.Equal(employee, communicationEvent.ToParty); Assert.Equal("subject", communicationEvent.Subject); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); Assert.Equal("comment", communicationEvent.Comment); }
public void Create() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First(); var organisation = allors.ActiveCustomers.First(v => v.GetType().Name == typeof(Organisation).Name); var contact = organisation.CurrentContacts.First; var employeeEmailAddress = employee.PersonalEmailAddress; var personEmailAddress = organisation.CurrentContacts.First.PersonalEmailAddress; this.Session.Derive(); this.Session.Commit(); var before = new EmailCommunications(this.Session).Extent().ToArray(); this.organisationListPage.Table.DefaultAction(organisation); var organisationOverview = new OrganisationOverviewComponent(this.organisationListPage.Driver); var communicationEventOverview = organisationOverview.CommunicationeventOverviewPanel.Click(); var emailCommunicationEdit = communicationEventOverview.CreateEmailCommunication(); emailCommunicationEdit .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment) .FromParty.Select(employee) .FromEmail.Select(employeeEmailAddress) .ToParty.Select(contact) .ToEmail.Select(personEmailAddress) .SubjectTemplate.Set("subject") .BodyTemplate.Set("body") .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new EmailCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var communicationEvent = after.Except(before).First(); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Appointment, communicationEvent.EventPurposes); Assert.Equal(employee, communicationEvent.FromParty); Assert.Equal(employeeEmailAddress, communicationEvent.FromEmail); Assert.Equal(contact, communicationEvent.ToParty); Assert.Equal(personEmailAddress, communicationEvent.ToEmail); Assert.Equal("subject", communicationEvent.EmailTemplate.SubjectTemplate); Assert.Equal("body", communicationEvent.EmailTemplate.BodyTemplate); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); }
public void Create() { var organisations = new Organisations(this.Session).Extent(); var organisation = organisations.First(v => v.PartyName.Equals("Acme0")); var contact = organisation.CurrentContacts.First; var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First(v => v.FirstName.Equals("first")); var employeeEmailAddress = employee.PersonalEmailAddress; var personEmailAddress = organisation.CurrentContacts.First.PersonalEmailAddress; this.Session.Derive(); this.Session.Commit(); var before = new EmailCommunications(this.Session).Extent().ToArray(); var organisationOverviewPage = this.organisationListPage.Select(organisation); var page = organisationOverviewPage.NewEmailCommunication(); page.EventState.Set(new CommunicationEventStates(this.Session).Completed.Name) .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment.Name) .FromParty.Set(employee.PartyName) .FromEmail.Set(employeeEmailAddress.ElectronicAddressString) .ToParty.Set(contact.PartyName) .ToEmail.Set(personEmailAddress.ElectronicAddressString) .Subject.Set("subject") .Body.Set("body") .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new EmailCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var communicationEvent = after.Except(before).First(); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Appointment, communicationEvent.EventPurposes); Assert.Equal(employee, communicationEvent.FromParty); Assert.Equal(employeeEmailAddress, communicationEvent.FromEmail); Assert.Equal(contact, communicationEvent.ToParty); Assert.Equal(personEmailAddress, communicationEvent.ToEmail); Assert.Equal("subject", communicationEvent.EmailTemplate.SubjectTemplate); Assert.Equal("body", communicationEvent.EmailTemplate.BodyTemplate); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); }
public void Create() { var organisations = new Organisations(this.Session).Extent(); var organisation = organisations.First(v => v.PartyName.Equals("Acme0")); var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First(v => v.FirstName.Equals("first")); var organisationAddress = new PostalAddressBuilder(this.Session) .WithAddress1("Haverwerf 15") .WithPostalBoundary(new PostalBoundaryBuilder(this.Session).WithLocality("city").WithPostalCode("1111").WithCountry(new Countries(this.Session).FindBy(M.Country.IsoCode, "BE")).Build()) .Build(); organisation.AddPartyContactMechanism(new PartyContactMechanismBuilder(this.Session).WithContactMechanism(organisationAddress).Build()); this.Session.Derive(); this.Session.Commit(); var before = new LetterCorrespondences(this.Session).Extent().ToArray(); var page = this.organisationListPage.Select(organisation).NewLetterCorrespondence(); page.EventState.Set(new CommunicationEventStates(this.Session).Completed.Name) .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment.Name) .FromParty.Set(organisation.PartyName) .ToParty.Set(employee.PartyName) .PostalAddress.Set("Haverwerf 15 1111 city Belgium") .Subject.Set("subject") .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .Comment.Set("comment") .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new LetterCorrespondences(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var communicationEvent = after.Except(before).First(); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Appointment, communicationEvent.EventPurposes); Assert.Equal(organisationAddress, communicationEvent.PostalAddress); Assert.Equal(organisation, communicationEvent.FromParty); Assert.Equal(employee, communicationEvent.ToParty); Assert.Equal("subject", communicationEvent.Subject); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); Assert.Equal("comment", communicationEvent.Comment); }
public void Edit() { var organisations = new Organisations(this.Session).Extent(); var organisation = organisations.First(v => v.PartyName.Equals("Acme0")); var contact = organisation.CurrentContacts.First; var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var firstEmployee = allors.ActiveEmployees.First(v => v.FirstName.Equals("first")); var secondEmployee = allors.ActiveEmployees.First(v => v.FirstName.Equals("second")); var editCommunicationEvent = new FaceToFaceCommunicationBuilder(this.Session) .WithSubject("dummy") .WithFromParty(organisation.CurrentContacts.First) .WithToParty(firstEmployee) .WithLocation("old location") .Build(); this.Session.Derive(); this.Session.Commit(); var before = new FaceToFaceCommunications(this.Session).Extent().ToArray(); var page = this.organisationListPage.Select(organisation).SelectFaceToFaceCommunication(editCommunicationEvent); page.EventState.Set(new CommunicationEventStates(this.Session).Completed.Name) .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Conference.Name) .Location.Set("new location") .Subject.Set("new subject") .FromParty.Set(secondEmployee.PartyName) .ToParty.Set(contact.PartyName) .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new FaceToFaceCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); Assert.Equal(new CommunicationEventStates(this.Session).Completed, editCommunicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Conference, editCommunicationEvent.EventPurposes); Assert.Equal(secondEmployee, editCommunicationEvent.FromParty); Assert.Equal(contact, editCommunicationEvent.ToParty); Assert.Equal("new location", editCommunicationEvent.Location); Assert.Equal("new subject", editCommunicationEvent.Subject); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledStart); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledEnd.Value.Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualStart.Value.Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualEnd.Value.Date); }
public void Edit() { var person = new People(this.Session).Extent().First; var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var firstEmployee = allors.ActiveEmployees.First(); var before = new PhoneCommunications(this.Session).Extent().ToArray(); this.people.Table.DefaultAction(person); var personOverview = new PersonOverviewComponent(this.people.Driver); var communicationEventOverview = personOverview.CommunicationeventOverviewPanel.Click(); communicationEventOverview.Table.DefaultAction(this.editCommunicationEvent); var phoneCommunicationEditComponent = new PhoneCommunicationEditComponent(this.Driver); phoneCommunicationEditComponent .LeftVoiceMail.Set(false) .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry) .FromPhoneNumber.Select(this.anotherPhoneNumber.ContactMechanism) .Subject.Set("new subject") .FromParty.Select(firstEmployee) .ToParty.Select(person) .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 25)) .Comment.Set("new comment") .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PhoneCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); Assert.False(this.editCommunicationEvent.LeftVoiceMail); Assert.Equal(new CommunicationEventStates(this.Session).Completed, this.editCommunicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, this.editCommunicationEvent.EventPurposes); Assert.Equal(firstEmployee, this.editCommunicationEvent.FromParty); Assert.Equal(person, this.editCommunicationEvent.ToParty); Assert.Equal(this.anotherPhoneNumber.ContactMechanism, this.editCommunicationEvent.PhoneNumber); Assert.Equal("new subject", this.editCommunicationEvent.Subject); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledStart); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledEnd.Value.Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualStart.Value.Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualEnd.Value.Date); Assert.Equal("new comment", this.editCommunicationEvent.Comment); }
public void Create() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First; var before = new PhoneCommunications(this.Session).Extent().ToArray(); var extent = new Organisations(this.Session).Extent(); var organisation = extent.First(v => v.PartyName.Equals("Acme0")); var contact = organisation.CurrentContacts.First(v => v.FirstName.Equals("Jane0")); var organisationOverviewPage = this.organisations.Select(organisation); var page = organisationOverviewPage.NewPhoneCommunication(); page.LeftVoiceMail.Set(true) .EventState.Set(new CommunicationEventStates(this.Session).Completed.Name) .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry.Name) .Subject.Set("subject") .FromParty.Set(contact.PartyName) .ToParty.Set(employee.PartyName) .PhoneNumber.Set("+1 123 456") .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .Comment.Set("comment") .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PhoneCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var communicationEvent = after.Except(before).First(); Assert.True(communicationEvent.LeftVoiceMail); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, communicationEvent.EventPurposes); Assert.Equal(contact, communicationEvent.FromParty); Assert.Equal(employee, communicationEvent.ToParty); Assert.Equal(contact.GeneralPhoneNumber, communicationEvent.PhoneNumber); Assert.Equal("subject", communicationEvent.Subject); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); Assert.Equal("comment", communicationEvent.Comment); }
public void Create() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First; var before = new PhoneCommunications(this.Session).Extent().ToArray(); var person = new People(this.Session).Extent().First; this.people.Table.DefaultAction(person); var communicationEventOverview = new PersonOverviewComponent(this.people.Driver).CommunicationeventOverviewPanel.Click(); communicationEventOverview .CreatePhoneCommunication() .LeftVoiceMail.Set(true) .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry) .Subject.Set("subject") .FromParty.Select(person) .ToParty.Select(employee) .FromPhoneNumber.Select(person.GeneralPhoneNumber) .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .Comment.Set("comment") .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PhoneCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var communicationEvent = after.Except(before).First(); Assert.True(communicationEvent.LeftVoiceMail); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, communicationEvent.EventPurposes); Assert.Equal(person, communicationEvent.FromParty); Assert.Equal(employee, communicationEvent.ToParty); Assert.Equal(person.GeneralPhoneNumber, communicationEvent.PhoneNumber); Assert.Equal("subject", communicationEvent.Subject); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); Assert.Equal("comment", communicationEvent.Comment); }
public void Edit() { var employer = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = new PersonBuilder(this.Session).WithLastName("employee").Build(); // Delete all existing for the new one to be in the first page of the list. foreach (PartyRelationship partyRelationship in employer.PartyRelationshipsWhereParty) { partyRelationship.Delete(); } this.Session.Derive(); this.Session.Commit(); var editPartyRelationship = new EmploymentBuilder(this.Session) .WithEmployee(employee) .WithEmployer(employer) .Build(); this.Session.Derive(); this.Session.Commit(); var before = new Employments(this.Session).Extent().ToArray(); this.organisationListPage.Table.DefaultAction(employer); var organisationOverview = new OrganisationOverviewComponent(this.organisationListPage.Driver); var partyRelationshipOverview = organisationOverview.PartyrelationshipOverviewPanel.Click(); partyRelationshipOverview.Table.DefaultAction(editPartyRelationship); var partyRelationshipEdit = new EmploymentEditComponent(organisationOverview.Driver); partyRelationshipEdit .FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new Employments(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); Assert.Equal(employer, editPartyRelationship.Employer); Assert.Equal(employee, editPartyRelationship.Employee); }
public void Edit() { var extent = new Organisations(this.Session).Extent(); var organisation = extent.First(v => v.PartyName.Equals("Acme0")); var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var firstEmployee = allors.ActiveEmployees.First(v => v.FirstName.Equals("first")); var before = new PhoneCommunications(this.Session).Extent().ToArray(); var personOverview = this.organisations.Select(organisation); var page = personOverview.SelectPhoneCommunication(this.editCommunicationEvent); page.LeftVoiceMail.Set(false) .EventState.Set(new CommunicationEventStates(this.Session).Completed.Name) .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry.Name) .FromParty.Set(organisation.PartyName) .ToParty.Set(firstEmployee.PartyName) .PhoneNumber.Set("+1 111 222") .Subject.Set("new subject") .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 25)) .Comment.Set("new comment") .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PhoneCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); Assert.False(this.editCommunicationEvent.LeftVoiceMail); Assert.Equal(new CommunicationEventStates(this.Session).Completed, this.editCommunicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, this.editCommunicationEvent.EventPurposes); Assert.Equal(organisation, this.editCommunicationEvent.FromParty); Assert.Equal(firstEmployee, this.editCommunicationEvent.ToParty); Assert.Equal(this.organisationPhoneNumber.ContactMechanism, this.editCommunicationEvent.PhoneNumber); Assert.Equal("new subject", this.editCommunicationEvent.Subject); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledStart); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledEnd.Value.Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualStart.Value.Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualEnd.Value.Date); Assert.Equal("new comment", this.editCommunicationEvent.Comment); }
public void Create() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First; var before = new FaceToFaceCommunications(this.Session).Extent().ToArray(); var extent = new Organisations(this.Session).Extent(); var organisation = extent.First(v => v.PartyName.Equals("Acme0")); var contact = organisation.CurrentContacts.First; var personOverview = this.organisationListPage.Select(organisation); var page = personOverview.NewFaceToFaceCommunication(); page.EventState.Set(new CommunicationEventStates(this.Session).Completed.Name) .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment.Name) .Location.Set("location") .Subject.Set("subject") .FromParty.Set(employee.PartyName) .ToParty.Set(contact.PartyName) .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new FaceToFaceCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var communicationEvent = after.Except(before).First(); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Appointment, communicationEvent.EventPurposes); Assert.Equal(employee, communicationEvent.FromParty); Assert.Equal(contact, communicationEvent.ToParty); Assert.Equal("location", communicationEvent.Location); Assert.Equal("subject", communicationEvent.Subject); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); }
public void Create() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First; var before = new FaceToFaceCommunications(this.Session).Extent().ToArray(); var person = new People(this.Session).Extent().First; this.personListPage.Table.DefaultAction(person); var faceToFaceCommunicationEdit = new PersonOverviewComponent(this.personListPage.Driver).CommunicationeventOverviewPanel.Click().CreateFaceToFaceCommunication(); faceToFaceCommunicationEdit .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment) .Location.Set("location") .Subject.Set("subject") .FromParty.Select(employee) .ToParty.Select(person) .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new FaceToFaceCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var communicationEvent = after.Except(before).First(); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Appointment, communicationEvent.EventPurposes); Assert.Equal(employee, communicationEvent.FromParty); Assert.Equal(person, communicationEvent.ToParty); Assert.Equal("location", communicationEvent.Location); Assert.Equal("subject", communicationEvent.Subject); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); }
public void Edit() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var person = new People(this.Session).Extent().First; var editPartyRelationship = new CustomerRelationshipBuilder(this.Session) .WithCustomer(person) .WithInternalOrganisation(allors) .Build(); this.Session.Derive(); this.Session.Commit(); var before = new PartyRelationships(this.Session).Extent().ToArray(); this.personListPage.Table.DefaultAction(person); var personOverview = new PersonOverviewComponent(this.personListPage.Driver); var partyRelationshipOverview = personOverview.PartyrelationshipOverviewPanel.Click(); partyRelationshipOverview.Table.DefaultAction(editPartyRelationship); var customerRelationshipEditComponent = new CustomerRelationshipEditComponent(this.Driver); customerRelationshipEditComponent.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new PartyRelationships(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date); // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); }
public void Create() { var employer = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = new PersonBuilder(this.Session).WithLastName("employee").Build(); // Delete all existing for the new one to be in the first page of the list. foreach (PartyRelationship relationship in employer.PartyRelationshipsWhereParty) { relationship.Delete(); } this.Session.Derive(); this.Session.Commit(); var before = new Employments(this.Session).Extent().ToArray(); var page = this.organisationListPage.Select(employer).NewEmployment(); page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22)) .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1)) .Employee.Set(employee.PartyName) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new Employments(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var partyRelationship = after.Except(before).First(); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date); Assert.Equal(employer, partyRelationship.Employer); Assert.Equal(employee, partyRelationship.Employee); }
public void Edit() { var faker = this.Session.Faker(); var subject = faker.Lorem.Sentence(); var location = faker.Address.FullAddress(); var person = new People(this.Session).Extent().First; var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var firstEmployee = allors.ActiveEmployees.First(); var secondEmployee = allors.ActiveEmployees.Last(); var editCommunicationEvent = new FaceToFaceCommunicationBuilder(this.Session) .WithSubject(subject) .WithFromParty(person) .WithToParty(firstEmployee) .WithLocation(location) .Build(); this.Session.Derive(); this.Session.Commit(); var before = new FaceToFaceCommunications(this.Session).Extent().ToArray(); this.personListPage.Table.DefaultAction(person); var personOverview = new PersonOverviewComponent(this.personListPage.Driver); var communicationEventOverview = personOverview.CommunicationeventOverviewPanel.Click(); communicationEventOverview.Table.DefaultAction(editCommunicationEvent); var faceToFaceCommunicationEditComponent = new FaceToFaceCommunicationEditComponent(this.Driver); var scheduleStartDate = DateTimeFactory.CreateDate(2018, 12, 24); var scheduleEndDate = DateTimeFactory.CreateDate(2018, 12, 24); var actualStartDate = DateTimeFactory.CreateDate(2018, 12, 24); var actualEndDate = DateTimeFactory.CreateDate(2018, 12, 24); faceToFaceCommunicationEditComponent .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Conference) .Subject.Set(subject) .Location.Set(location) .FromParty.Select(secondEmployee) .ToParty.Select(person) .ScheduledStart.Set(scheduleStartDate) .ScheduledEnd.Set(scheduleEndDate) .ActualStart.Set(actualStartDate) .ActualEnd.Set(actualEndDate) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new FaceToFaceCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); Assert.Equal(new CommunicationEventStates(this.Session).Completed, editCommunicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Conference, editCommunicationEvent.EventPurposes); Assert.Equal(secondEmployee, editCommunicationEvent.FromParty); Assert.Equal(person, editCommunicationEvent.ToParty); Assert.Equal(subject, editCommunicationEvent.Subject); Assert.Equal(location, editCommunicationEvent.Location); Assert.Equal(scheduleStartDate.Date, editCommunicationEvent.ScheduledStart.Value.Date); Assert.Equal(scheduleEndDate.Date, editCommunicationEvent.ScheduledEnd.Value.Date); Assert.Equal(actualStartDate.Date, editCommunicationEvent.ActualStart.Value.Date); Assert.Equal(actualEndDate.Date, editCommunicationEvent.ActualEnd.Value.Date); }
public void Edit() { var person = new People(this.Session).Extent().First; var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First(); var address = new PostalAddressBuilder(this.Session) .WithAddress1("Haverwerf 15") .WithLocality("city") .WithPostalCode("1111") .WithCountry(new Countries(this.Session).FindBy(M.Country.IsoCode, "BE")) .Build(); person.AddPartyContactMechanism(new PartyContactMechanismBuilder(this.Session).WithContactMechanism(address).Build()); var employeeAddress = new PostalAddressBuilder(this.Session) .WithAddress1("home sweet home") .WithLocality("suncity") .WithPostalCode("0000") .WithCountry(new Countries(this.Session).FindBy(M.Country.IsoCode, "BE")) .Build(); employee.AddPartyContactMechanism(new PartyContactMechanismBuilder(this.Session).WithContactMechanism(employeeAddress).Build()); var editCommunicationEvent = new LetterCorrespondenceBuilder(this.Session) .WithSubject("dummy") .WithFromParty(employee) .WithToParty(person) .WithPostalAddress(address) .Build(); this.Session.Derive(); this.Session.Commit(); var before = new LetterCorrespondences(this.Session).Extent().ToArray(); var postalAddress = (PostalAddress)person.PartyContactMechanisms.First(v => v.ContactMechanism.GetType().Name == typeof(PostalAddress).Name).ContactMechanism; this.personListPage.Table.DefaultAction(person); var personOverview = new PersonOverviewComponent(this.personListPage.Driver); var communicationEventOverview = personOverview.CommunicationeventOverviewPanel.Click(); communicationEventOverview.Table.DefaultAction(editCommunicationEvent); var letterCorrespondenceEditComponent = new LetterCorrespondenceEditComponent(this.Driver); letterCorrespondenceEditComponent .CommunicationEventState.Select(new CommunicationEventStates(this.Session).InProgress) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment) .FromParty.Select(person) .ToParty.Select(employee) .FromPostalAddress.Select(postalAddress) .Subject.Set("new subject") .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .Comment.Set("new comment") .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new LetterCorrespondences(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); Assert.Equal(new CommunicationEventStates(this.Session).InProgress, editCommunicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Appointment, editCommunicationEvent.EventPurposes); Assert.Equal(person, editCommunicationEvent.FromParty); Assert.Equal(employee, editCommunicationEvent.ToParty); Assert.Equal(postalAddress, editCommunicationEvent.PostalAddress); Assert.Equal("new subject", editCommunicationEvent.Subject); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, editCommunicationEvent.ScheduledStart.Value.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, editCommunicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ActualStart.Value.Date.ToUniversalTime().Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date); Assert.Equal("new comment", editCommunicationEvent.Comment); }
public void Edit() { var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var firstEmployee = allors.ActiveEmployees.First(); var secondEmployee = allors.CreateEmployee("letmein", this.Session.Faker()); //second employee this.Session.Derive(); var organisation = allors.ActiveCustomers.First(v => v.GetType().Name == typeof(Organisation).Name); var contact = organisation.CurrentContacts.First; var editCommunicationEvent = new FaceToFaceCommunicationBuilder(this.Session) .WithSubject("dummy") .WithFromParty(organisation.CurrentContacts.First) .WithToParty(firstEmployee) .WithLocation("old location") .Build(); this.Session.Derive(); this.Session.Commit(); var before = new FaceToFaceCommunications(this.Session).Extent().ToArray(); this.organisationListPage.Table.DefaultAction(organisation); var organisationOverview = new OrganisationOverviewComponent(this.organisationListPage.Driver); var communicationEventOverview = organisationOverview.CommunicationeventOverviewPanel.Click(); communicationEventOverview.Table.DefaultAction(editCommunicationEvent); var faceToFaceCommunicationEdit = new FaceToFaceCommunicationEditComponent(organisationOverview.Driver); faceToFaceCommunicationEdit .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Conference) .Location.Set("new location") .Subject.Set("new subject") .FromParty.Select(secondEmployee) .ToParty.Select(contact) .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new FaceToFaceCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); Assert.Equal(new CommunicationEventStates(this.Session).Completed, editCommunicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Conference, editCommunicationEvent.EventPurposes); Assert.Equal(secondEmployee, editCommunicationEvent.FromParty); Assert.Equal(contact, editCommunicationEvent.ToParty); Assert.Equal("new location", editCommunicationEvent.Location); Assert.Equal("new subject", editCommunicationEvent.Subject); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ScheduledStart); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ScheduledEnd.Value.Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ActualStart.Value.Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ActualEnd.Value.Date); }
public void Edit() { var people = new People(this.Session).Extent(); var person = people.First(v => v.PartyName.Equals("John0 Doe0")); var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First(v => v.FirstName.Equals("first")); var employeeEmailAddress = employee.PersonalEmailAddress; var personEmailAddress = person.PersonalEmailAddress; var editCommunicationEvent = new EmailCommunicationBuilder(this.Session) .WithSubject("dummy") .WithFromEmail(employeeEmailAddress) .WithToEmail(personEmailAddress) .WithEmailTemplate(new EmailTemplateBuilder(this.Session).Build()) .Build(); this.Session.Derive(); this.Session.Commit(); var before = new EmailCommunications(this.Session).Extent().ToArray(); var personOverview = this.personListPage.Select(person); var page = personOverview.SelectEmailCommunication(editCommunicationEvent); page.EventState.Set(new CommunicationEventStates(this.Session).Completed.Name) .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry.Name) .FromParty.Set(person.PartyName) .FromEmail.Set(personEmailAddress.ElectronicAddressString) .ToParty.Set(employee.PartyName) .ToEmail.Set(employeeEmailAddress.ElectronicAddressString) .Subject.Set("new subject") .Body.Set("new body") .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .Save.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new EmailCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); Assert.Equal(new CommunicationEventStates(this.Session).Completed, editCommunicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, editCommunicationEvent.EventPurposes); Assert.Equal(person, editCommunicationEvent.FromParty); Assert.Equal(personEmailAddress, editCommunicationEvent.FromEmail); Assert.Equal(employee, editCommunicationEvent.ToParty); Assert.Equal(employeeEmailAddress, editCommunicationEvent.ToEmail); Assert.Equal("new subject", editCommunicationEvent.EmailTemplate.SubjectTemplate); Assert.Equal("new body", editCommunicationEvent.EmailTemplate.BodyTemplate); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledStart); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledEnd.Value.Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualStart.Value.Date); //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualEnd.Value.Date); }
public void Edit() { var person = new People(this.Session).Extent().First; var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA"); var employee = allors.ActiveEmployees.First(); var employeeEmailAddress = employee.PersonalEmailAddress; var personEmailAddress = person.PersonalEmailAddress; var editCommunicationEvent = new EmailCommunicationBuilder(this.Session) .WithSubject("dummy") .WithFromEmail(employeeEmailAddress) .WithFromParty(employee) .WithToParty(person) .WithToEmail(personEmailAddress) .WithEmailTemplate(new EmailTemplateBuilder(this.Session).Build()) .Build(); this.Session.Derive(); this.Session.Commit(); var before = new EmailCommunications(this.Session).Extent().ToArray(); this.personListPage.Table.DefaultAction(person); var personOverview = new PersonOverviewComponent(this.personListPage.Driver); var communicationEventOverview = personOverview.CommunicationeventOverviewPanel.Click(); communicationEventOverview.Table.DefaultAction(editCommunicationEvent); var emailCommunicationEdit = new EmailCommunicationEditComponent(this.Driver); emailCommunicationEdit .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed) .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry) .FromParty.Select(person) .FromEmail.Select(personEmailAddress) .ToParty.Select(employee) .ToEmail.Select(employeeEmailAddress) .SubjectTemplate.Set("new subject") .BodyTemplate.Set("new body") .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 24)) .SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new EmailCommunications(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length); Assert.Equal(new CommunicationEventStates(this.Session).Completed, editCommunicationEvent.CommunicationEventState); Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, editCommunicationEvent.EventPurposes); Assert.Equal(person, editCommunicationEvent.FromParty); Assert.Equal(personEmailAddress, editCommunicationEvent.FromEmail); Assert.Equal(employee, editCommunicationEvent.ToParty); Assert.Equal(employeeEmailAddress, editCommunicationEvent.ToEmail); Assert.Equal("new subject", editCommunicationEvent.EmailTemplate.SubjectTemplate); Assert.Equal("new body", editCommunicationEvent.EmailTemplate.BodyTemplate); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ScheduledStart); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ScheduledEnd.Value.Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ActualStart.Value.Date); Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, editCommunicationEvent.ActualEnd.Value.Date); }