public void GetInfoMYUser() { #region Parameters List <string> dataUser = UsersBDSteps.ReturnMyUser(); //Expected Result int statusCode = 200; string userName = dataUser[1]; #endregion #region Request myUser = new GET_MyUserInfoRequest(); response = myUser.ExecuteRequest(); #endregion #region Assert Assert.Multiple(() => { Assert.AreEqual(statusCode, (int)response.StatusCode); Assert.AreEqual(userName, response.Data["name"].ToString()); }); #endregion }
public void CreateUserIgual() { #region Parameters List <string> dataUser = UsersBDSteps.ReturnMyUser(); string username = dataUser[1]; string password = "******"; string real_name = dataUser[2]; string email = dataUser[3]; string nameLevel = "updater";//dataUser[7]; string enabled = "true"; string protectedLevel = "false"; //Expected Result string statusCodeExpected = "BadRequest"; string message = "Username '" + username + "' already used."; string statusCode = "800"; string localized = "That username is already being used. Please go back and select another one."; #endregion #region Request createUser = new POST_CreateOneUserRequest(); createUser.SetJsonBody(username, password, real_name, email, nameLevel, enabled, protectedLevel); response = createUser.ExecuteRequest(); #endregion #region Assert Assert.Multiple(() => { Assert.AreEqual(statusCodeExpected, response.StatusCode.ToString()); Assert.AreEqual(message, response.Data["message"].ToString()); Assert.AreEqual(statusCode, response.Data["code"].ToString()); Assert.AreEqual(localized, response.Data["localized"].ToString()); }); #endregion }