public void UpdateProfile(Profile profile) { apiRequest.UpdateProfile(profile); }
public void UpdateProfile(Profile profile) { if (profile == null) { throw new ArgumentNullException("profile"); } if (profile.ProfileId <= 0) { throw new ArgumentException("profileId must be specified"); } var args = new Dictionary<string, string>(); args["profileId"] = profile.ProfileId.ToString(); string endPointUrl = ApiEndpointUris.GenerateEndPointUri(ApiEndpointUris.Profile_View, requestSettings, args); var putContent = new Dictionary<string, string>(); putContent["primaryEmail"] = profile.Email; putContent["givenName"] = profile.FirstName; putContent["surName"] = profile.Surname; putContent["dialCode"] = profile.DialCode; putContent["cellPhone"] = profile.CellPhoneNumber; putContent["countryOfBirthId"] = profile.CountryOfBirthId.Value.ToString(); var result = apiHttpRequester.IssueApiPUTRequest<Profile>(endPointUrl, putContent); }
public void ShouldUpdateProfile() { int profileId = 324784; Profile profile = new Profile() { ProfileId = profileId, FirstName = "Basil", Surname = "Brown", Email = "*****@*****.**", DialCode = "+44", CellPhoneNumber = "123456" }; ApiRequest apiRequest = new ApiRequest(requestSettings); apiRequest.UpdateProfile(profile); var selectedProfile = apiRequest.GetProfile(profileId); Assert.AreEqual("Basil", selectedProfile.FirstName); Assert.AreEqual("Brown", selectedProfile.Surname); Assert.AreEqual("*****@*****.**", selectedProfile.Email); Assert.AreEqual("+44", selectedProfile.DialCode); Assert.AreEqual("123456", selectedProfile.CellPhoneNumber); }