public void CreateNoteInIssueSucess() { #region Parameters List <string> dataIssue = IssuesBDSteps.ReturnIdIssuesRandom(); string issue_id = dataIssue[0]; string viewStatus = "private"; string text = "test note " + GeneralHelpers.ReturnStringWithRandomCharacters(10); //Expected Result string statusCodeEsperado = "Created"; #endregion #region Request noteIssue = new POST_CreateNoteInIssueRequest(issue_id); noteIssue.SetJsonBody(viewStatus, text); response = noteIssue.ExecuteRequest(); #endregion #region Assert Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString()); #endregion }
public void CreateNoteInIssueErro() { #region Parameters List <string> dataIssue = IssuesBDSteps.ReturnIdIssuesRandom(); string issue_id = dataIssue[0]; string nameView_state = ""; string text = ""; //Expected Result string statusCodeExpected = "BadRequest"; string message = "Issue note not specified."; string code = "11"; string localized = "A necessary field \"Note\" was empty. Please recheck your inputs."; #endregion #region Request noteIssue = new POST_CreateNoteInIssueRequest(issue_id); noteIssue.SetJsonBody(nameView_state, text); response = noteIssue.ExecuteRequest(); #endregion #region Assert Assert.Multiple(() => { Assert.AreEqual(statusCodeExpected, response.StatusCode.ToString()); Assert.AreEqual(message, response.Data["message"].ToString()); Assert.AreEqual(code, response.Data["code"].ToString()); Assert.AreEqual(localized, response.Data["localized"].ToString()); }); #endregion }
public void CreateNoteInIssueDataDriven(ArrayList dataTest) { #region Parameters List <string> dataIssue = IssuesBDSteps.ReturnIdIssuesRandom(); string issue_id = dataIssue[0]; string nameView_state = ""; string text = dataTest[0].ToString(); //Expected Result string statusCodeEsperado = "Created"; #endregion #region Request noteIssue = new POST_CreateNoteInIssueRequest(issue_id); noteIssue.SetJsonBody(nameView_state, text); response = noteIssue.ExecuteRequest(); #endregion #region Assert Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString()); #endregion }