Ejemplo n.º 1
0
 public IHttpActionResult Get([FromUri] Guid id)
 {
     try
     {
         Utils.IsAValidToken(Request, AuthorizationBusinessLogic);
         var text = TextBusinessLogic.GetText(id);
         return(Ok(TextModel.ToModel(text)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Ejemplo n.º 2
0
        public void IntegrationTest_ExpectedParameters_Ok()
        {
            TextDataAccess    textDA = new TextDataAccess();
            BodyDataAccess    bodyDA = new BodyDataAccess();
            TextBusinessLogic textBL = new TextBusinessLogic(textDA);
            Text text1 = Utils.CreateTextForTest();
            Text text2 = Utils.CreateTextForTest();

            textBL.AddText(text1);
            textBL.AddText(text2);

            text2.OwnStyleClass = "Other style";
            textBL.ModifyText(text2);

            textBL.DeleteText(text1.Id);

            Text         text2Obtained = textBL.GetText(text2.Id);
            IList <Text> textsObtained = textBL.GetTexts();

            Assert.IsTrue(!textsObtained.Contains(text1) && textsObtained.Contains(text2Obtained));
        }