Exemplo n.º 1
0
        private void CreateExtraProfiles()
        {
            var profileRepo = new ProfileRepository();

            for (int i = 0; i < ProfileIds.Count; i++)
            {
                var profile = new Profile
                                  {
                                      AccountName = AccountIds[i],
                                      ProfileName = ProfileIds[i],
                                      Locations =
                                          new List<Location> { new Location(LocationBendName), new Location(LocationPortland) },
                                      SportsPlayed = new List<SportWithSkillLevel>
                                                         {
                                                             new SportWithSkillLevel
                                                                 {
                                                                     Name = SoccerName,
                                                                     SkillLevel = new SkillLevel(2)
                                                                 },
                                                             new SportWithSkillLevel
                                                                 {
                                                                     Name = Basketballname,
                                                                     SkillLevel = new SkillLevel(7)
                                                                 },
                                                             new SportWithSkillLevel
                                                                 {
                                                                     Name = FootballName,
                                                                     SkillLevel = new SkillLevel(5)
                                                                 }
                                                         }
                                  };
                profileRepo.Save(profile);
            }
        }
Exemplo n.º 2
0
        public ActionResult FriendList()
        {
            var friends = new ProfileRepository().GetFriendsProfileNameList(GetProfileFromCookie());

            var model = new FriendsListModel {FriendsProfileIds = friends};

            return View(model);
        }
Exemplo n.º 3
0
        public Profile CreateProfileForAccount2()
        {
            var profileRepo = new ProfileRepository();

            var profile = new Profile
                              {
                                  AccountName = "*****@*****.**",
                                  ProfileName = Profile2Id,
                                  Locations = new List<Location> { new Location(LocationBendName), new Location(LocationPortland) },
                                  SportsPlayed = new List<SportWithSkillLevel>
                                                     {new SportWithSkillLevel
                                                          {
                                                            Name = SoccerName,
                                                            SkillLevel = new SkillLevel(5)
                                                        },
                                                     new SportWithSkillLevel
                                                          {
                                                            Name = Basketballname,
                                                            SkillLevel = new SkillLevel(5)
                                                        }}
                              };
            profileRepo.Save(profile);
            return profile;
        }
Exemplo n.º 4
0
        public Profile CreateProfileForAccount1()
        {
            var profileRepo = new ProfileRepository();

            var profile = new Profile
                              {
                                  AccountName = "*****@*****.**",
                                  ProfileName = Profile1Id,
                                  Locations = new List<Location> { new Location(LocationBendName) },
                                  SportsPlayed = new List<SportWithSkillLevel>
                                                     {new SportWithSkillLevel
                                                            {
                                                                Name = Basketballname,
                                                                SkillLevel = new SkillLevel(3)
                                                            }}
                              };
            profileRepo.Save(profile);
            return profile;
        }
Exemplo n.º 5
0
        public void CreateFriendshipForProfile1And2()
        {
            var profileRepo = new ProfileRepository();

            profileRepo.AddFriendToProfile(Profile1Id, Profile2Id);
        }
        public void SetUp()
        {
            SqlServerDataHelper.DeleteAllData();

            _repo = new ProfileRepository();
        }
Exemplo n.º 7
0
        private IList<Location> GetLocationsForProfile(string profileId)
        {
            var repo = new ProfileRepository();

            var profile = repo.GetByProfileId(profileId);

            return profile.Locations;
        }