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