public void CreateMinimal() { var before = new Organisations(this.Session).Extent().ToArray(); var expected = new OrganisationBuilder(this.Session).WithDefaults().Build(); this.Session.Derive(); var expectedName = expected.Name; var organisationCreate = this.organisationListPage .CreateOrganisation() .Build(expected, true); this.Session.Rollback(); organisationCreate.SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new Organisations(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var actual = after.Except(before).First(); Assert.Equal(expectedName, actual.Name); Assert.False(actual.ExistTaxNumber); Assert.False(actual.ExistLegalForm); Assert.False(actual.ExistLocale); Assert.False(actual.ExistIndustryClassifications); Assert.False(actual.ExistIndustryClassifications); Assert.False(actual.IsManufacturer); Assert.False(actual.ExistComment); }
public void Create() { 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(); this.organisationListPage.AddNew.Click(); var before = new Organisations(this.Session).Extent().ToArray(); var page = new OrganisationEditPage(this.Driver); 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 + 1); var organisation = after.Except(before).First(); Assert.Equal("new organisation", organisation.Name); Assert.Equal("BE 123 456 789 01", organisation.TaxNumber); Assert.Equal(legalForm, organisation.LegalForm); Assert.Equal(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 CreateFull() { var before = new Organisations(this.Session).Extent().ToArray(); var expected = new OrganisationBuilder(this.Session).WithDefaults().Build(); this.Session.Derive(); var expectedName = expected.Name; var expectedTaxNumber = expected.TaxNumber; var expectedLegalFormDescription = expected.LegalForm.Description; var expectedLocaleName = expected.Locale.Name; var expectedIsManufacturer = expected.IsManufacturer; var expectedComment = expected.Comment; var organisationCreate = this.organisationListPage .CreateOrganisation() .Build(expected); organisationCreate.AssertFull(expected); this.Session.Rollback(); organisationCreate.SAVE.Click(); this.Driver.WaitForAngular(); this.Session.Rollback(); var after = new Organisations(this.Session).Extent().ToArray(); Assert.Equal(after.Length, before.Length + 1); var actual = after.Except(before).First(); Assert.Equal(expectedName, actual.Name); Assert.Equal(expectedTaxNumber, actual.TaxNumber); Assert.Equal(expectedLegalFormDescription, actual.LegalForm.Description); Assert.Equal(expectedLocaleName, actual.Locale.Name); Assert.Equal(expectedIsManufacturer, actual.IsManufacturer); Assert.Equal(expectedComment, actual.Comment); }