Example #1
0
        public Result JoinTribe(HardTribe tribe)
        {
            Result res = tribe.RequestAdmission(this, this);
            if (res.Succeeded)
                MyTribes.Add(tribe);

            return res;
        }
        protected TribesRepository PopulateDummyTribes()
        {
            //arrange
            Chief user1 = new Chief { RegistrationInfo = new Account { FirstName = "Jones", LastName = "Pavan", EmailAddress = "*****@*****.**", Password = "******" } };

            User[] users = {new User {RegistrationInfo= new Account {FirstName="Jones", LastName="Pavan", EmailAddress="*****@*****.**", Password="******"}},
                            new User {RegistrationInfo= new Account {FirstName="Isabella", LastName="Pavan", EmailAddress="*****@*****.**", Password="******"}},
                            new User {RegistrationInfo= new Account {FirstName="Gabriel", LastName="Pavan", EmailAddress="*****@*****.**", Password="******"}},
                            new User {RegistrationInfo= new Account {FirstName="Danielle", LastName="Pavan", EmailAddress="*****@*****.**", Password="******"}}
                           };

            HardTribe trib1 = new HardTribe
            {
                Name = "test1",
                Owner = user1
            };

            HardTribe trib2 = new HardTribe
            {
                Name = "test2",
                Owner = user1
            };

            HardTribe trib3 = new HardTribe
            {
                Name = "test3",
                Owner = user1
            };

            foreach (User u in users)
            {
                trib1.RequestAdmission(u,u);
                trib2.RequestAdmission(u, u);
                trib3.RequestAdmission(u, u);
            }

            //act
            TribesRepository repo = new TribesRepository();
            repo.UpsertTribe(trib1);
            repo.UpsertTribe(trib2);
            repo.UpsertTribe(trib3);

            return repo;
        }
Example #3
0
 public Result LeaveTribe(HardTribe tribe)
 {
     return tribe.RequestExclusion(this, this);
 }