Beispiel #1
0
        public void ConstructorShouldCreateNewEvent()
        {
            Group    group = new Group("open");
            DateTime time  = new DateTime(2017, 03, 23);

            dotnet_g23.Models.Domain.Action action = new dotnet_g23.Models.Domain.Action(group, "Foobar", "Foobar", time);
            Assert.Equal(time, action.Date);
        }
Beispiel #2
0
        public void ConstructorShouldCreateNewAction()
        {
            Group group = new Group("open");

            dotnet_g23.Models.Domain.Action action = new dotnet_g23.Models.Domain.Action(group, "Foobar", "Foobar");
            Assert.Null(action.Date);
            Assert.Equal(group, action.Group);
        }
Beispiel #3
0
        public DummyApplicationDbContext()
        {
            /**
             * Organizations
             *
             * */

            Organizations = new List <Organization>();

            HogentGent     = new Organization("HoGent", "Gent", "hogent.be");
            HogentAalst    = new Organization("HoGent", "Aalst", "hogent.be");
            HowestKortrijk = new Organization("Howest", "Kortrijk", "howest.be");
            HowestBrugge   = new Organization("Howest", "Brugge", "howest.be");
            Ugent          = new Organization("UGent", "Gent", "ugent.be");

            Organizations.Add(HogentGent);
            Organizations.Add(HogentAalst);
            Organizations.Add(HowestKortrijk);
            Organizations.Add(HowestBrugge);
            Organizations.Add(Ugent);

            /**
             * Users
             *
             * */

            GUsers = new List <GUser>();

            VolunteerHoGent      = new GUser("*****@*****.**");
            ParticipantHogent    = new GUser("*****@*****.**");
            OwnerHogent          = new GUser("*****@*****.**");
            OwnerHogentSubmitted = new GUser("*****@*****.**");
            OwnerHogentApproved  = new GUser("*****@*****.**");
            OwnerHogentGranted   = new GUser("*****@*****.**");
            OwnerHogentAnnounced = new GUser("*****@*****.**");

            GUsers.Add(VolunteerHoGent);
            GUsers.Add(ParticipantHogent);
            GUsers.Add(OwnerHogent);
            GUsers.Add(OwnerHogentSubmitted);
            GUsers.Add(OwnerHogentApproved);
            GUsers.Add(OwnerHogentGranted);
            GUsers.Add(OwnerHogentAnnounced);

            HogentGent.Register(ParticipantHogent);
            HogentGent.Register(OwnerHogent);
            HogentGent.Register(OwnerHogentSubmitted);
            HogentGent.Register(OwnerHogentApproved);
            HogentGent.Register(OwnerHogentGranted);
            HogentGent.Register(OwnerHogentAnnounced);

            Participants = new List <Participant>();
            Participants.Add(ParticipantHogent.UserState as Participant);
            Participants.Add(OwnerHogent.UserState as Participant);
            Participants.Add(OwnerHogentSubmitted.UserState as Participant);
            Participants.Add(OwnerHogentApproved.UserState as Participant);
            Participants.Add(OwnerHogentGranted.UserState as Participant);
            Participants.Add(OwnerHogentAnnounced.UserState as Participant);

            /**
             * Groups
             *
             * */

            Groups = new List <Group>();

            HogentGroup          = HogentGent.CreateGroup(OwnerHogent.UserState as Participant, "HoGent Groep 1", false);
            HogentGroupSubmitted = HogentGent.CreateGroup(OwnerHogentSubmitted.UserState as Participant, "HoGent Groep 2", false);
            HogentGroupApproved  = HogentGent.CreateGroup(OwnerHogentApproved.UserState as Participant, "HoGent Groep 3", false);
            HogentGroupGranted   = HogentGent.CreateGroup(OwnerHogentGranted.UserState as Participant, "HoGent Groep 4", false);
            HogentGroupAnnounced = HogentGent.CreateGroup(OwnerHogentAnnounced.UserState as Participant, "HoGent Groep 5", false);

            Groups.Add(HogentGroup);
            Groups.Add(HogentGroupSubmitted);
            Groups.Add(HogentGroupApproved);
            Groups.Add(HogentGroupGranted);
            Groups.Add(HogentGroupAnnounced);

            /**
             * Motivations
             *
             * */

            Motivations = new List <Motivation>();

            MotivationSubmitted = CreateMotivation(HogentGroupSubmitted, false);
            MotivationApproved  = CreateMotivation(HogentGroupApproved, true);
            MotivationGranted   = CreateMotivation(HogentGroupGranted, true);
            MotivationAnnounced = CreateMotivation(HogentGroupAnnounced, true);

            Motivations.Add(MotivationSubmitted);
            Motivations.Add(MotivationApproved);
            Motivations.Add(MotivationGranted);
            Motivations.Add(MotivationAnnounced);

            /**
             * Companies
             *
             * */

            Companies = new List <Company>();

            Company1 = new Company("Company 1", "This is company 1", "Address of company 1", "http://www.company1.com", "*****@*****.**", new byte[] { 0x20, 0x20, 0x20 });
            Company2 = new Company("Company 2", "This is company 2", "Address of company 2", "http://www.company2.com", "*****@*****.**", new byte[] { 0x20, 0x20, 0x20 });
            Company3 = new Company("Company 3", "This is company 3", "Address of company 3", "http://www.company3.com", "*****@*****.**", new byte[] { 0x20, 0x20, 0x20 });

            Companies.Add(Company1);
            Companies.Add(Company2);
            Companies.Add(Company3);

            /**
             * Contacts
             *
             * */

            Contacts = new List <Contact>();

            Contact1Ceo = new Contact("Mr.", "John", "Doe", "CEO", "*****@*****.**", Company1);
            Contact1Cfo = new Contact("Mr.", "James", "Doe", "CFO", "*****@*****.**", Company1);
            Contact1Cto = new Contact("Mrs.", "Jane", "Doe", "CTO", "*****@*****.**", Company1);

            Company1.Contacts.Add(Contact1Ceo);
            Company1.Contacts.Add(Contact1Cfo);
            Company1.Contacts.Add(Contact1Cto);

            Contacts.Add(Contact1Ceo);
            Contacts.Add(Contact1Cfo);
            Contacts.Add(Contact1Cto);

            Contact2Ceo = new Contact("Mr.", "John", "Doe", "CEO", "*****@*****.**", Company2);
            Contact2Cfo = new Contact("Mr.", "James", "Doe", "CFO", "*****@*****.**", Company2);
            Contact2Cto = new Contact("Mrs.", "Jane", "Doe", "CTO", "*****@*****.**", Company2);

            Company2.Contacts.Add(Contact2Ceo);
            Company2.Contacts.Add(Contact2Cfo);
            Company2.Contacts.Add(Contact2Cto);

            Contacts.Add(Contact2Ceo);
            Contacts.Add(Contact2Cfo);
            Contacts.Add(Contact2Cto);

            Contact3Ceo = new Contact("Mr.", "John", "Doe", "CEO", "*****@*****.**", Company3);
            Contact3Cfo = new Contact("Mr.", "James", "Doe", "CFO", "*****@*****.**", Company3);
            Contact3Cto = new Contact("Mrs.", "Jane", "Doe", "CTO", "*****@*****.**", Company3);

            Company3.Contacts.Add(Contact3Ceo);
            Company3.Contacts.Add(Contact3Cfo);
            Company3.Contacts.Add(Contact3Cto);

            Contacts.Add(Contact3Ceo);
            Contacts.Add(Contact3Cfo);
            Contacts.Add(Contact3Cto);

            /**
             * Labels
             *
             * */

            Labels = new List <Label>();

            HogentGroupGranted.Grant(Company2);
            HogentGroupAnnounced.Grant(Company3);

            Labels.Add(HogentGroupGranted.Label);
            Labels.Add(HogentGroupAnnounced.Label);

            /**
             * Posts
             *
             * */

            Posts = new List <Post>();

            Post3 = HogentGroupAnnounced.Announce("Dit Goed Bezig-label wordt toegekend aan Company 3 vanwege een voortdurende inzet en maatschappelijke verantwoordelijkheid.");

            Posts.Add(Post3);

            /**
             * Actions
             *
             * */

            Actions = new List <dotnet_g23.Models.Domain.Action>();

            Action1 = new dotnet_g23.Models.Domain.Action(HogentGroupGranted, "Action1", "Dit is een actie tvv Goed Bezig!");
            Action2 = new dotnet_g23.Models.Domain.Action(HogentGroupAnnounced, "Action2", "Dit is een actie tvv Goed Bezig!");

            Actions.Add(Action1);
            Actions.Add(Action2);
        }