public void IntegrationTest_ExpectedParameters_Ok() { ParagraphDataAccess paragraphDA = new ParagraphDataAccess(); ParagraphBusinessLogic paragraphBL = new ParagraphBusinessLogic(paragraphDA); Paragraph paragraph1 = Utils.CreateParagraphForTest(); Paragraph paragraph2 = Utils.CreateParagraphForTest(); paragraphBL.AddParagraph(paragraph1); paragraphBL.AddParagraph(paragraph2); paragraph2.PutTextAtLast(text); paragraphBL.ModifyParagraph(paragraph2); paragraphBL.DeleteParagraph(paragraph1.Id); Paragraph paragraph2Obtained = paragraphBL.GetParagraph(paragraph2.Id); IList <Paragraph> paragraphsObtained = paragraphBL.GetParagraphs(); Assert.IsTrue(!paragraphsObtained.Contains(paragraph1) && paragraphsObtained.Contains(paragraph2Obtained)); }
// POST: api/Paragraph public IHttpActionResult Post([FromBody] ParagraphModel paragraphModel) { try { Utils.IsAValidToken(Request, AuthorizationBusinessLogic); ParagraphBusinessLogic.AddParagraph(paragraphModel.ToEntity()); return(Ok(paragraphModel)); } catch (Exception e) { return(BadRequest(e.Message)); } }