예제 #1
0
        private void CustomOnPostSetup()
        {
            new OrganisationBuilder(this.session).WithName("Acme").Build();

            new PersonBuilder(this.session).WithFirstName("John").WithLastName("Doe").WithUserName("*****@*****.**").Build();
            new PersonBuilder(this.session).WithFirstName("Jane").WithLastName("Doe").WithUserName("*****@*****.**").Build();

            // Create cycles between Organisation and Person
            var cycleOrganisation1 = new OrganisationBuilder(this.session).WithName("Organisatin Cycle One").Build();
            var cycleOrganisation2 = new OrganisationBuilder(this.session).WithName("Organisatin Cycle Two").Build();

            var cyclePerson1 = new PersonBuilder(this.session).WithFirstName("Person Cycle").WithLastName("One").WithUserName("*****@*****.**").Build();
            var cyclePerson2 = new PersonBuilder(this.session).WithFirstName("Person Cycle").WithLastName("Two").WithUserName("*****@*****.**").Build();

            // One
            cycleOrganisation1.CycleOne = cyclePerson1;
            cyclePerson1.CycleOne       = cycleOrganisation1;

            cycleOrganisation2.CycleOne = cyclePerson2;
            cyclePerson2.CycleOne       = cycleOrganisation2;

            // Many
            cycleOrganisation1.AddCycleMany(cyclePerson1);
            cycleOrganisation1.AddCycleMany(cyclePerson2);

            cycleOrganisation1.AddCycleMany(cyclePerson1);
            cycleOrganisation1.AddCycleMany(cyclePerson2);

            cyclePerson1.AddCycleMany(cycleOrganisation1);
            cyclePerson1.AddCycleMany(cycleOrganisation2);

            cyclePerson2.AddCycleMany(cycleOrganisation1);
            cyclePerson2.AddCycleMany(cycleOrganisation2);
        }
예제 #2
0
파일: Setup.cs 프로젝트: lulzzz/allors2
        private void CustomOnPostSetup()
        {
            var genders = new Genders(this.session);

            var john  = new PersonBuilder(this.session).WithFirstName("John").WithLastName("Doe").WithUserName("*****@*****.**").WithNormalizedUserName("*****@*****.**").WithGender(genders.Male).Build();
            var jane  = new PersonBuilder(this.session).WithFirstName("Jane").WithLastName("Doe").WithUserName("*****@*****.**").WithNormalizedUserName("*****@*****.**").WithGender(genders.Female).Build();
            var jenny = new PersonBuilder(this.session).WithFirstName("Jenny").WithLastName("Doe").WithUserName("*****@*****.**").WithNormalizedUserName("*****@*****.**").WithGender(genders.Other).Build();

            john.SetPassword("john");
            jane.SetPassword("jane");
            jenny.SetPassword("jenny");

            var acme = new OrganisationBuilder(this.session)
                       .WithName("Acme")
                       .WithOwner(jane)
                       .WithEmployee(john)
                       .WithEmployee(jenny)
                       .Build();

            for (var i = 0; i < 100; i++)
            {
                new OrganisationBuilder(this.session)
                .WithName($"Organisation-{i}")
                .WithOwner(john)
                .WithEmployee(jenny)
                .WithEmployee(jane)
                .Build();
            }

            new UserGroups(this.session).Administrators.AddMember(john);

            // Create cycles between Organisation and Person
            var cycleOrganisation1 = new OrganisationBuilder(this.session).WithName("Organisatin Cycle One").Build();
            var cycleOrganisation2 = new OrganisationBuilder(this.session).WithName("Organisatin Cycle Two").Build();

            var cyclePerson1 = new PersonBuilder(this.session).WithFirstName("Person Cycle").WithLastName("One").WithUserName("*****@*****.**").Build();
            var cyclePerson2 = new PersonBuilder(this.session).WithFirstName("Person Cycle").WithLastName("Two").WithUserName("*****@*****.**").Build();

            // One
            cycleOrganisation1.CycleOne = cyclePerson1;
            cyclePerson1.CycleOne       = cycleOrganisation1;

            cycleOrganisation2.CycleOne = cyclePerson2;
            cyclePerson2.CycleOne       = cycleOrganisation2;

            // Many
            cycleOrganisation1.AddCycleMany(cyclePerson1);
            cycleOrganisation1.AddCycleMany(cyclePerson2);

            cycleOrganisation1.AddCycleMany(cyclePerson1);
            cycleOrganisation1.AddCycleMany(cyclePerson2);

            cyclePerson1.AddCycleMany(cycleOrganisation1);
            cyclePerson1.AddCycleMany(cycleOrganisation2);

            cyclePerson2.AddCycleMany(cycleOrganisation1);
            cyclePerson2.AddCycleMany(cycleOrganisation2);
        }
예제 #3
0
파일: Setup.cs 프로젝트: Allors/allors2
        private void CustomOnPostSetup()
        {
            var avatar = new Medias(this.session).Avatar;

            var place   = new PlaceBuilder(this.session).WithPostalCode("X").WithCity("London").WithCountry(new Countries(this.session).CountryByIsoCode["GB"]).Build();
            var address = new HomeAddressBuilder(this.session).WithStreet("Main Street").WithHouseNumber("1").WithPlace(place).Build();

            var genders = new Genders(this.session);

            var jane  = new PersonBuilder(this.session).WithMainAddress(address).WithFirstName("Jane").WithLastName("Doe").WithUserName("*****@*****.**").WithPhoto(avatar).WithGender(genders.Female).Build();
            var john  = new PersonBuilder(this.session).WithFirstName("John").WithLastName("Doe").WithUserName("*****@*****.**").WithPhoto(avatar).WithGender(genders.Male).Build();
            var jenny = new PersonBuilder(this.session).WithFirstName("Jenny").WithLastName("Doe").WithUserName("*****@*****.**").WithPhoto(avatar).WithGender(genders.Other).Build();

            jane.SetPassword("jane");
            john.SetPassword("john");
            jenny.SetPassword("jenny");

            new UserGroups(this.session).Administrators.AddMember(jane);
            new UserGroups(this.session).Creators.AddMember(jane);
            new UserGroups(this.session).Creators.AddMember(john);
            new UserGroups(this.session).Creators.AddMember(jenny);

            var acme = new OrganisationBuilder(this.session)
                       .WithName("Acme")
                       .WithOwner(jane)
                       .WithEmployee(john)
                       .WithEmployee(jenny)
                       .Build();

            for (var i = 0; i < 90; i++)
            {
                new OrganisationBuilder(this.session)
                .WithName($"Organisation-{i}")
                .WithOwner(john)
                .WithEmployee(jenny)
                .WithEmployee(jane)
                .Build();
            }

            for (var i = 0; i < 10; i++)
            {
                new OrganisationBuilder(this.session)
                .WithIsCustomer(true)
                .WithName($"Customer-{i}")
                .WithOwner(john)
                .WithEmployee(jane)
                .Build();
            }

            // Create cycles between Organisation and Person
            var cycleOrganisation1 = new OrganisationBuilder(this.session).WithName("Organisatin Cycle One").Build();
            var cycleOrganisation2 = new OrganisationBuilder(this.session).WithName("Organisatin Cycle Two").Build();

            var cyclePerson1 = new PersonBuilder(this.session).WithFirstName("Person Cycle").WithLastName("One").WithUserName("*****@*****.**").Build();
            var cyclePerson2 = new PersonBuilder(this.session).WithFirstName("Person Cycle").WithLastName("Two").WithUserName("*****@*****.**").Build();

            // One
            cycleOrganisation1.CycleOne = cyclePerson1;
            cyclePerson1.CycleOne       = cycleOrganisation1;

            cycleOrganisation2.CycleOne = cyclePerson2;
            cyclePerson2.CycleOne       = cycleOrganisation2;

            // Many
            cycleOrganisation1.AddCycleMany(cyclePerson1);
            cycleOrganisation1.AddCycleMany(cyclePerson2);

            cycleOrganisation1.AddCycleMany(cyclePerson1);
            cycleOrganisation1.AddCycleMany(cyclePerson2);

            cyclePerson1.AddCycleMany(cycleOrganisation1);
            cyclePerson1.AddCycleMany(cycleOrganisation2);

            cyclePerson2.AddCycleMany(cycleOrganisation1);
            cyclePerson2.AddCycleMany(cycleOrganisation2);

            // MediaTyped
            var mediaTyped = new MediaTypedBuilder(this.session).WithMarkdown(@"
# Markdown
1.  List item one.

    List item one continued with a second paragraph followed by an
    Indented block.

        $ ls *.sh
        $ mv *.sh ~/tmp

    List item continued with a third paragraph.

2.  List item two continued with an open block.

    This paragraph is part of the preceding list item.

    1. This list is nested and does not require explicit item continuation.

       This paragraph is part of the preceding list item.

    2. List item b.

    This paragraph belongs to item two of the outer list.
").Build();
        }