public PersonPhoneCommunicationEditTest(TestFixture fixture) : base(fixture) { 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(); this.editCommunicationEvent = new PhoneCommunicationBuilder(this.Session) .WithSubject("dummy") .WithLeftVoiceMail(true) .WithFromParty(person) .WithToParty(firstEmployee) .WithPhoneNumber(person.GeneralPhoneNumber) .Build(); this.anotherPhoneNumber = 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(); person.AddPartyContactMechanism(this.anotherPhoneNumber); this.Session.Derive(); this.Session.Commit(); this.Login(); this.people = this.Sidenav.NavigateToPeople(); }
public PostalAddressCreateTest(TestFixture fixture) : base(fixture) { var person = new People(this.Session).Extent().First; this.editContactMechanism = new PostalAddressBuilder(this.Session) .WithDefaults() .Build(); var partyContactMechanism = new PartyContactMechanismBuilder(this.Session).WithContactMechanism(this.editContactMechanism).Build(); person.AddPartyContactMechanism(partyContactMechanism); this.Session.Derive(); this.Session.Commit(); this.Login(); this.people = this.Sidenav.NavigateToPeople(); }
public WebAddressEditTest(TestFixture fixture) : base(fixture) { var person = new People(this.Session).Extent().First; this.editContactMechanism = new WebAddressBuilder(this.Session) .WithElectronicAddressString("www.acme.com") .Build(); var partyContactMechanism = new PartyContactMechanismBuilder(this.Session).WithContactMechanism(editContactMechanism).Build(); person.AddPartyContactMechanism(partyContactMechanism); this.Session.Derive(); this.Session.Commit(); this.Login(); this.personListPage = this.Sidenav.NavigateToPeople(); }
public void Edit() { var person = new People(this.Session).Extent().First; var editContactMechanism = new WebAddressBuilder(this.Session) .WithElectronicAddressString("www.acme.com") .Build(); var partyContactMechanism = new PartyContactMechanismBuilder(this.Session).WithContactMechanism(editContactMechanism).Build(); person.AddPartyContactMechanism(partyContactMechanism); this.Session.Derive(); this.Session.Commit(); 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 TelecommunicationsNumberCreateTest(TestFixture fixture) : base(fixture) { var person = new People(this.Session).Extent().First; this.editContactMechanism = new TelecommunicationsNumberBuilder(this.Session) .WithCountryCode("0032") .WithAreaCode("498") .WithContactNumber("123 456") .Build(); var partyContactMechanism = new PartyContactMechanismBuilder(this.Session).WithContactMechanism(this.editContactMechanism).Build(); person.AddPartyContactMechanism(partyContactMechanism); this.Session.Derive(); this.Session.Commit(); this.Login(); this.people = this.Sidenav.NavigateToPeople(); }
public PartyContactMechanismCreateTest(TestFixture fixture) : base(fixture) { var person = new People(this.Session).Extent().First; var postalAddress = new PostalAddressBuilder(this.Session) .WithAddress1("Haverwerf 15") .WithLocality("city") .WithPostalCode("1111") .WithCountry(new Countries(this.Session).FindBy(M.Country.IsoCode, "BE")) .Build(); this.editPartyContactMechanism = new PartyContactMechanismBuilder(this.Session).WithContactMechanism(postalAddress).Build(); person.AddPartyContactMechanism(this.editPartyContactMechanism); this.Session.Derive(); this.Session.Commit(); this.Login(); this.people = this.Sidenav.NavigateToPeople(); }
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); }