public void TestMatch() { MatchLogic matchLogic = new MatchLogic(); var dataManager = new DataManager(); MatchRequest req = new MatchRequest(); var userDataPuddy = new UserProfileRequest { //UserID = 69, UserName = "******", ProfileAttributeType = ProfileAttributeTypeEnum.All }; UserProfileData match = dataManager.FetchProfile(userDataPuddy); // This is elaine. req.UserID = 6969; MatchResponse response = matchLogic.GetMatchByLocation(req); if (response != null) { if (response.MatchProfiles != null && response.MatchProfiles.Count() > 0) { foreach (ChoiceProfile cp in response.MatchProfiles) { cp.ChoiceType = ChoiceTypeEnum.Like; } // Add the match profiles var userProfileData = new UserProfileData { UserData = match.UserData, UserChoices = response.MatchProfiles }; dataManager.ModifyProfile(userProfileData); } } }
public void TestUpdateProfileData() { var dataManager = new DataManager(); /* var userData = new UserData { UserID = 34, UserName = "******", FirstName = "David", LastName = "Puddy", Email = "*****@*****.**", DisplayName = "Pud6dy9", PhoneNumber = "3016969696", Password = "******" }; ProfileEntity userResponse = new ProfileEntity { Id = 8, ID = 12, QuestionID = 1 }; ProfileEntity matchResponseUpdate = new ProfileEntity { Id = 11, ID = 13, QuestionID = 2 }; ProfileEntity matchResponseNew = new ProfileEntity { Id = 27, }; List<ProfileEntity> userRespounses = new List<ProfileEntity>(); userRespounses.Add(userResponse); List<ProfileEntity> matchRespounses = new List<ProfileEntity>(); matchRespounses.Add(matchResponseUpdate); matchRespounses.Add(matchResponseNew); var userProfileData = new UserProfileData { UserData = userData, UserResponses = userRespounses, MatchResponses = matchRespounses }; dataManager.ModifyProfile(userProfileData); */ /* if (data.UserData != null) { data.UserData.DisplayName = "Giddy6969"; ProfileEntity userResponse = new ProfileEntity { Id = 17, ResponseTypeID = 2 }; List<ProfileEntity> userRespounses = new List<ProfileEntity>(); userRespounses.Add(userResponse); ProfileEntity matchResponse = new ProfileEntity { Id = 19, ResponseTypeID = 2 }; ProfileEntity matchResponse2 = new ProfileEntity { Id = 20, ResponseTypeID = 2 }; List<ProfileEntity> matchRespounses = new List<ProfileEntity>(); matchRespounses.Add(matchResponse); matchRespounses.Add(matchResponse2); var userProfileData = new UserProfileData { UserData = data.UserData, //UserResponses = userRespounses, MatchResponses = matchRespounses }; dataManager.ModifyProfile(userProfileData); } */ var userDataPuddy = new UserProfileRequest { //UserID = 69, UserName = "******", ProfileAttributeType = ProfileAttributeTypeEnum.All }; UserProfileData match = dataManager.FetchProfile(userDataPuddy); if (match.UserData != null) { //match.UserData.DisplayName = "Giddy6969"; ProfileEntity userResponse = new ProfileEntity { Id = 17, ResponseTypeID = 2 }; ProfileEntity userResponse2 = new ProfileEntity { Id = 12, ResponseTypeID = 1 }; ProfileEntity userResponse3 = new ProfileEntity { Id = 6, ResponseTypeID = 3 }; List<ProfileEntity> userRespounses = new List<ProfileEntity>(); userRespounses.Add(userResponse); userRespounses.Add(userResponse2); userRespounses.Add(userResponse3); ProfileEntity matchResponse = new ProfileEntity { Id = 7, ResponseTypeID = 3 }; ProfileEntity matchResponse2 = new ProfileEntity { Id = 24, ResponseTypeID = 4 }; ProfileEntity matchResponse3 = new ProfileEntity { Id = 10, ResponseTypeID = 1 }; ProfileEntity matchResponse4 = new ProfileEntity { Id = 23, ResponseTypeID = 2 }; List<ProfileEntity> matchRespounses = new List<ProfileEntity>(); matchRespounses.Add(matchResponse); matchRespounses.Add(matchResponse2); matchRespounses.Add(matchResponse3); matchRespounses.Add(matchResponse4); var userProfileData = new UserProfileData { UserData = match.UserData, UserResponses = userRespounses, MatchResponses = matchRespounses }; dataManager.ModifyProfile(userProfileData); } /* ProfileEntity matchResponseNew = new ProfileEntity { Id = 3, }; ChoiceProfile choiceResponse = new ChoiceProfile { ChoiceType = ChoiceTypeEnum.Like, UserID = 34, MatchUser = new UserData { UserID = 12, UserName = "******" } }; List<ChoiceProfile> userChoices = new List<ChoiceProfile>(); userChoices.Add(choiceResponse); var userProfileData = new UserProfileData { UserData = data.UserData, UserChoices = userChoices }; dataManager.ModifyProfile(userProfileData); */ }
public void TestFetchProfileData() { try { var dataManager = new DataManager(); var userData = new UserProfileRequest { //UserID = 69, UserName = "******", ProfileAttributeType = ProfileAttributeTypeEnum.All }; UserProfileData data = dataManager.FetchProfile(userData); // No user found if (data.UserData == null) { string msg = "miserable little failure"; } } catch (Exception ex) { string theEx = ex.InnerException.InnerException.Message; } }