Ejemplo n.º 1
0
        private async Task <bool> TestEditContact(string id, string first_name, string last_name, string nickname, string image,
                                                  string email, string phone, string phone_2, string skype, string country, string city, string status)
        {
            var jObj     = DataModels.GetDataModelUserInfo(id, first_name, last_name, nickname, image, email, phone, phone_2, skype, country, city, status);
            var modelExp = WebMsgParser.ParseResponsePersonalInfo(jObj.ToString());

            var statusCode = await _requests.Auth(email);

            if (statusCode != HttpStatusCode.OK)
            {
                return(false);
            }

            var response = await _requests.UpdateEditContactInfo(email, skype, country, city, phone);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                return(false);
            }

            var responseStream = new StreamReader(response.Content.ReadAsStreamAsync().Result);
            var responseString = responseStream.ReadToEnd();

            responseStream.Dispose();

            var modelAct = WebMsgParser.ParseResponsePersonalInfo(responseString);

            var result = modelExp.Equals(modelAct);

            return(result);
        }
        public void ParseResponseRecoveryPassword_Positive(string data, bool expSuccess, string expMessage, string[] expErrors, string testName)
        {
            DataRecoveryPasswordResponse actResponse = WebMsgParser.ParseResponseRecoveryPassword(data);

            Assert.AreEqual(expSuccess, actResponse.Success);
            Assert.AreEqual(expMessage, actResponse.Message);
            CollectionAssert.AreEqual(expErrors.ToList(), actResponse.Errors);
        }
 public void ParseResponseRecoveryPassword_Negative(string data, string testName)
 {
     Assert.Throws <ParseException>(() => WebMsgParser.ParseResponseRecoveryPassword(data));
 }