public override void SetUp()
        {
            base.SetUp();
            this.population = new Population(this.Session);

            this.johnDoe = new PersonBuilder(this.Session)
                           .WithUserName("johndoe")
                           .WithFirstName("John")
                           .WithLastName("Doe")
                           .Build();

            this.janeDoe = new PersonBuilder(this.Session)
                           .WithUserName("janedoe")
                           .WithFirstName("Jane")
                           .WithLastName("Doe")
                           .Build();

            this.organisation = new OrganisationBuilder(this.Session)
                                .WithName("Acme")
                                .Build();

            this.administrators = new UserGroups(this.Session).Administrators;
            this.guests         = new UserGroups(this.Session).Guests;

            this.guests.AddMember(this.johnDoe);

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

            this.Driver.Navigate().GoToUrl(Test.AppUrl);
            this.Page = new OrganisationEditPage(this.Driver);
        }
Exemplo n.º 2
0
        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 override void SetUp()
        {
            base.SetUp();
            this.population = new Population(this.Session);

            this.johnDoe = new PersonBuilder(this.Session)
                           .WithUserName("johndoe")
                           .WithFirstName("John")
                           .WithLastName("Doe")
                           .Build();

            this.janeDoe = new PersonBuilder(this.Session)
                           .WithUserName("janedoe")
                           .WithFirstName("Jane")
                           .WithLastName("Doe")
                           .Build();

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

            this.Driver.Navigate().GoToUrl(Test.AppUrl);
            this.Page = new OrganisationEditPage(this.Driver);
        }