예제 #1
0
 public IHttpActionResult Get()
 {
     try
     {
         Utils.IsAValidToken(Request, AuthorizationBusinessLogic);
         var margins = MarginBusinessLogic.GetMargins();
         IList <MarginModel> marginsModel = MarginModel.ToModel(margins).ToList();
         return(Ok(marginsModel));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
        public void IntegrationTest_ExpectedParameters_Ok()
        {
            MarginDataAccess    marginDA = new MarginDataAccess();
            MarginBusinessLogic marginBL = new MarginBusinessLogic(marginDA);
            Margin margin1 = Utils.CreateMarginForTest();
            Margin margin2 = Utils.CreateMarginForTest();

            marginBL.AddMargin(margin1);
            marginBL.AddMargin(margin2);

            margin2.SetText(text);
            marginBL.ModifyMargin(margin2);

            marginBL.DeleteMargin(margin1.Id);

            Margin         margin2Obtained = marginBL.GetMargin(margin2.Id);
            IList <Margin> marginsObtained = marginBL.GetMargins();

            Assert.IsTrue(!marginsObtained.Contains(margin1) && marginsObtained.Contains(margin2Obtained));
        }