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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public OrganisationPhoneCommunicationEditTest(TestFixture fixture)
            : base(fixture)
        {
            var people       = new Organisations(this.Session).Extent();
            var organisation = people.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"));

            this.editCommunicationEvent = new PhoneCommunicationBuilder(this.Session)
                                          .WithSubject("dummy")
                                          .WithLeftVoiceMail(true)
                                          .WithFromParty(firstEmployee)
                                          .WithToParty(organisation.CurrentContacts.First)
                                          .WithPhoneNumber(organisation.GeneralPhoneNumber)
                                          .Build();

            this.organisationPhoneNumber = new PartyContactMechanismBuilder(this.Session)
                                           .WithContactMechanism(new TelecommunicationsNumberBuilder(this.Session).WithCountryCode("+1").WithAreaCode("111").WithContactNumber("222").Build())
                                           .WithContactPurpose(new ContactMechanismPurposes(this.Session).SalesOffice)
                                           .WithUseAsDefault(false)
                                           .Build();

            organisation.AddPartyContactMechanism(this.organisationPhoneNumber);

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

            var dashboard = this.Login();

            this.organisations = dashboard.Sidenav.NavigateToOrganisationList();
        }
예제 #4
0
        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);
        }
예제 #5
0
        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 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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        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);
        }
예제 #9
0
        public void Edit()
        {
            var customOrganisationClassification = new CustomOrganisationClassificationBuilder(this.Session).WithName("Gold").Build();
            var industryClassification           = new IndustryClassificationBuilder(this.Session).WithName("Retail").Build();
            var legalForm = new LegalForms(this.Session).FindBy(M.LegalForm.Description, "BE - BVBA / SPRL");

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

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

            var organisation = before.First(v => v.PartyName.Equals("Acme0"));
            var id           = organisation.Id;

            var organisationOverviewPage = this.organisationListPage.Select(organisation);
            var page = organisationOverviewPage.Edit();

            page.Name.Set("new organisation")
            .TaxNumber.Set("BE 123 456 789 01")
            .LegalForm.Set(legalForm.Description)
            .Locale.Set(this.Session.GetSingleton().AdditionalLocales.First.Name)
            .IndustryClassifications.Toggle(industryClassification.Name)
            .CustomClassifications.Toggle(customOrganisationClassification.Name)
            .IsManufacturer.Set(true)
            .IsInternalOrganisation.Set(true)
            .Comment.Set("comment")
            .Save.Click();

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

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

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

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

            Assert.Equal("new organisation", organisation.Name);
            Assert.Equal("BE 123 456 789 01", organisation.TaxNumber);
            Assert.Equal(legalForm, organisation.LegalForm);
            Assert.Equal(this.Session.GetSingleton().AdditionalLocales.First, organisation.Locale);
            Assert.Contains(industryClassification, organisation.IndustryClassifications);
            Assert.Contains(customOrganisationClassification, organisation.CustomClassifications);
            Assert.True(organisation.IsManufacturer);
            Assert.True(organisation.IsInternalOrganisation);
            Assert.Equal("comment", organisation.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);
        }
예제 #11
0
        public void Edit()
        {
            var customOrganisationClassification = new CustomOrganisationClassificationBuilder(this.Session).WithName("Gold").Build();
            var industryClassification           = new IndustryClassificationBuilder(this.Session).WithName("Retail").Build();
            var legalForm = new LegalForms(this.Session).FindBy(M.LegalForm.Description, "BE - BVBA / SPRL");

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

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

            var organisation = before.Last();
            var id           = organisation.Id;

            this.organisationListPage.Table.DefaultAction(organisation);
            var organisationOverview       = new OrganisationOverviewComponent(this.organisationListPage.Driver);
            var organisationOverviewDetail = organisationOverview.OrganisationOverviewDetail.Click();

            organisationOverviewDetail
            .Name.Set("new organisation")
            .TaxNumber.Set("BE 123 456 789 01")
            .LegalForm.Select(legalForm)
            .Locale.Select(this.Session.GetSingleton().AdditionalLocales.First)
            .IndustryClassifications.Toggle(industryClassification)
            .CustomClassifications.Toggle(customOrganisationClassification)
            .IsManufacturer.Set(true)
            .Comment.Set("comment")
            .SAVE.Click();

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

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

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

            organisation = after.First(v => v.Id.Equals(id));
        }
예제 #12
0
        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 employee = allors.ActiveEmployees.First(v => v.FirstName.Equals("first"));

            var employeeEmailAddress = employee.PersonalEmailAddress;
            var personEmailAddress   = organisation.CurrentContacts.First.PersonalEmailAddress;

            var editCommunicationEvent = new EmailCommunicationBuilder(this.Session)
                                         .WithSubject("dummy")
                                         .WithFromParty(employee)
                                         .WithFromEmail(employeeEmailAddress)
                                         .WithToParty(organisation.CurrentContacts.First)
                                         .WithToEmail(personEmailAddress)
                                         .WithEmailTemplate(new EmailTemplateBuilder(this.Session).Build())
                                         .Build();

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

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

            var page = this.organisationListPage.Select(organisation).SelectEmailCommunication(editCommunicationEvent);

            page.EventState.Set(new CommunicationEventStates(this.Session).Completed.Name)
            .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry.Name)
            .FromParty.Set(contact.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(contact, 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);
        }