public void Create() { var country = new Countries(this.Session).FindBy(M.Country.IsoCode, "BE"); var before = new PostalAddresses(this.Session).Extent().ToArray(); var extent = new People(this.Session).Extent(); var person = extent.First(v => v.PartyName.Equals("John0 Doe0")); var personOverview = this.people.Select(person); var page = personOverview.NewPostalAddress(); page.ContactPurposes.Toggle(new ContactMechanismPurposes(this.Session).BillingAddress.Name) .Address1.Set("addressline 1") .Address2.Set("addressline 2") .Address3.Set("addressline 3") .Locality.Set("city") .PostalCode.Set("postalcode") .Country.Set(country.Name) .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.PostalBoundary.Locality); Assert.Equal("postalcode", contactMechanism.PostalBoundary.PostalCode); Assert.Equal(country, contactMechanism.PostalBoundary.Country); Assert.Equal("description", contactMechanism.Description); }
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); }