Beispiel #1
0
        public void Edit()
        {
            var person = new People(this.Session).Extent().First;

            var before = new WebAddresses(this.Session).Extent().ToArray();

            this.personListPage.Table.DefaultAction(person);
            var personOverview = new PersonOverviewComponent(this.personListPage.Driver);

            var contactMechanismOverview = personOverview.ContactmechanismOverviewPanel.Click();

            contactMechanismOverview.Table.DefaultAction(editContactMechanism);

            var webAddressEdit = new WebAddressEditComponent(this.Driver);

            webAddressEdit
            .ElectronicAddressString.Set("wwww.allors.com")
            .Description.Set("description")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new WebAddresses(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            Assert.Equal("wwww.allors.com", editContactMechanism.ElectronicAddressString);
            Assert.Equal("description", editContactMechanism.Description);
        }
        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 Edit()
        {
            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 personOverviewPage = new PersonOverviewComponent(this.people.Driver);

            var partyRelationshipOverview = personOverviewPage.PartyrelationshipOverviewPanel.Click();

            partyRelationshipOverview.Table.DefaultAction(this.editPartyRelationship);

            var employmentEditComponent = new EmploymentEditComponent(this.Driver);

            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);

            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);
        }
Beispiel #4
0
        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 WebAddresses(this.Session).Extent().ToArray();

            var person = new People(this.Session).Extent().First;

            this.personListPage.Table.DefaultAction(person);
            var webAddressCreate = new PersonOverviewComponent(this.personListPage.Driver).ContactmechanismOverviewPanel.Click().CreateWebAddress();

            webAddressCreate
            .ContactPurposes.Toggle(new ContactMechanismPurposes(this.Session).GeneralEmail)
            .ElectronicAddressString.Set("wwww.allors.com")
            .Description.Set("description")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new WebAddresses(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var contactMechanism = after.Except(before).First();

            Assert.Equal("wwww.allors.com", contactMechanism.ElectronicAddressString);
            Assert.Equal("description", contactMechanism.Description);
        }
Beispiel #6
0
        public void Create()
        {
            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;

            this.Session.Derive();
            this.Session.Commit();

            var before = new EmailCommunications(this.Session).Extent().ToArray();

            this.personListPage.Table.DefaultAction(person);
            var emailCommunicationEdit = new PersonOverviewComponent(this.personListPage.Driver).CommunicationeventOverviewPanel.Click().CreateEmailCommunication();

            emailCommunicationEdit
            .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed)
            .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment)
            .FromParty.Select(employee)
            .FromEmail.Select(employeeEmailAddress)
            .ToParty.Select(person)
            .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(person, 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 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 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);
        }
Beispiel #9
0
        public void Edit()
        {
            var country = new Countries(this.Session).FindBy(M.Country.IsoCode, "NL");

            var person = new People(this.Session).Extent().First;

            var before = new PostalAddresses(this.Session).Extent().ToArray();

            this.people.Table.DefaultAction(person);
            var personOverview = new PersonOverviewComponent(this.people.Driver);

            var panelComponent = personOverview.ContactmechanismOverviewPanel.Click();
            var row            = panelComponent.Table.FindRow(this.editContactMechanism);
            var cell           = row.FindCell("contact");

            cell.Click();

            var postalAddressEditComponent = new PostalAddressEditComponent(this.Driver);

            postalAddressEditComponent.Address1.Set("addressline 1")
            .Address2.Set("addressline 2")
            .Address3.Set("addressline 3")
            .Locality.Set("city")
            .PostalCode.Set("postalcode")
            .Country.Select(country)
            .Description.Set("description")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PostalAddresses(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            Assert.Equal("addressline 1", this.editContactMechanism.Address1);
            Assert.Equal("addressline 2", this.editContactMechanism.Address2);
            Assert.Equal("addressline 3", this.editContactMechanism.Address3);
            Assert.Equal("addressline 1", this.editContactMechanism.Address1);
            Assert.Equal("city", this.editContactMechanism.Locality);
            Assert.Equal("postalcode", this.editContactMechanism.PostalCode);
            Assert.Equal(country, this.editContactMechanism.Country);
            Assert.Equal("description", this.editContactMechanism.Description);
        }
Beispiel #10
0
        public void Create()
        {
            var country = new Countries(this.Session).FindBy(M.Country.IsoCode, "BE");

            var before = new PostalAddresses(this.Session).Extent().ToArray();

            var person = new People(this.Session).Extent().First;

            this.people.Table.DefaultAction(person);
            var postalAddressEditComponent = new PersonOverviewComponent(this.people.Driver).ContactmechanismOverviewPanel.Click().CreatePostalAddress();

            postalAddressEditComponent
            .ContactPurposes.Toggle(new ContactMechanismPurposes(this.Session).GeneralCorrespondence)
            .Address1.Set("addressline 1")
            .Address2.Set("addressline 2")
            .Address3.Set("addressline 3")
            .Locality.Set("city")
            .PostalCode.Set("postalcode")
            .Country.Select(country)
            .Description.Set("description")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PostalAddresses(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var contactMechanism      = after.Except(before).First();
            var partyContactMechanism = contactMechanism.PartyContactMechanismsWhereContactMechanism.First;

            Assert.Equal("addressline 1", contactMechanism.Address1);
            Assert.Equal("addressline 2", contactMechanism.Address2);
            Assert.Equal("addressline 3", contactMechanism.Address3);
            Assert.Equal("addressline 1", contactMechanism.Address1);
            Assert.Equal("city", contactMechanism.Locality);
            Assert.Equal("postalcode", contactMechanism.PostalCode);
            Assert.Equal(country, contactMechanism.Country);
            Assert.Equal("description", contactMechanism.Description);
        }
        public void Edit()
        {
            var person = new People(this.Session).Extent().First;

            var electronicAddress = new EmailAddressBuilder(this.Session)
                                    .WithElectronicAddressString("*****@*****.**")
                                    .Build();

            var partyContactMechanism = new PartyContactMechanismBuilder(this.Session).WithContactMechanism(electronicAddress).Build();

            person.AddPartyContactMechanism(partyContactMechanism);

            this.Session.Derive();
            this.Session.Commit();

            var before = new EmailAddresses(this.Session).Extent().ToArray();

            this.personListPage.Table.DefaultAction(person);
            var personOverviewComponent = new PersonOverviewComponent(this.personListPage.Driver);

            var contactMechanismOverviewPanel = personOverviewComponent.ContactmechanismOverviewPanel.Click();

            contactMechanismOverviewPanel.Table.DefaultAction(electronicAddress);

            var emailAddressEditComponent = new EmailAddressEditComponent(this.Driver);

            emailAddressEditComponent
            .ElectronicAddressString.Set("*****@*****.**")
            .Description.Set("description")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new EmailAddresses(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            Assert.Equal("*****@*****.**", electronicAddress.ElectronicAddressString);
            Assert.Equal("description", electronicAddress.Description);
        }
Beispiel #12
0
        public void Edit()
        {
            var before = new People(this.Session).Extent().ToArray();

            var person = before.First();
            var id     = person.Id;

            this.people.Table.DefaultAction(person);
            var personOverview       = new PersonOverviewComponent(this.people.Driver);
            var personOverviewDetail = personOverview.PersonOverviewDetail.Click();

            personOverviewDetail.Salutation.Select(new Salutations(this.Session).Mr)
            .FirstName.Set("Jos")
            .MiddleName.Set("de")
            .LastName.Set("Smos")
            .Function.Set("CEO")
            .Gender.Select(new GenderTypes(this.Session).Male)
            .Locale.Select(this.Session.GetSingleton().AdditionalLocales.First)
            .Comment.Set("unpleasant person")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new People(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            person = after.First(v => v.Id.Equals(id));

            Assert.Equal(new Salutations(this.Session).Mr, person.Salutation);
            Assert.Equal("Jos", person.FirstName);
            Assert.Equal("de", person.MiddleName);
            Assert.Equal("Smos", person.LastName);
            Assert.Equal("CEO", person.Function);
            Assert.Equal(new GenderTypes(this.Session).Male, person.Gender);
            Assert.Equal(this.Session.GetSingleton().AdditionalLocales.First, person.Locale);
            Assert.Equal("unpleasant person", person.Comment);
        }
Beispiel #13
0
        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 Edit()
        {
            var person = new People(this.Session).Extent().First;

            var before = new TelecommunicationsNumbers(this.Session).Extent().ToArray();

            this.people.Table.DefaultAction(person);
            var personOverview = new PersonOverviewComponent(this.people.Driver);

            var contactMechanismOverview = personOverview.ContactmechanismOverviewPanel.Click();
            var row  = contactMechanismOverview.Table.FindRow(this.editContactMechanism);
            var cell = row.FindCell("contact");

            cell.Click();

            var editComponent = new TelecommunicationsNumberEditComponent(this.Driver);

            editComponent
            .CountryCode.Set("111")
            .AreaCode.Set("222")
            .ContactNumber.Set("333")
            .ContactMechanismType.Select(new ContactMechanismTypes(this.Session).MobilePhone)
            .Description.Set("description")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new TelecommunicationsNumbers(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            Assert.Equal("111", this.editContactMechanism.CountryCode);
            Assert.Equal("222", this.editContactMechanism.AreaCode);
            Assert.Equal("333", this.editContactMechanism.ContactNumber);
            Assert.Equal(new ContactMechanismTypes(this.Session).MobilePhone, this.editContactMechanism.ContactMechanismType);
            Assert.Equal("description", this.editContactMechanism.Description);
        }
        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);
        }
Beispiel #16
0
        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 secondEmployee = allors.ActiveEmployees.Last();

            var editCommunicationEvent = new FaceToFaceCommunicationBuilder(this.Session)
                                         .WithSubject("dummy")
                                         .WithFromParty(person)
                                         .WithToParty(firstEmployee)
                                         .WithLocation("old 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);

            ;
            faceToFaceCommunicationEditComponent
            .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(person)
            .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(person, 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 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);
        }