Exemple #1
0
        public JsonResult FunctionDelete(int functionId)
        {
            var responser = new ResponseModel <int>();

            if (!_functionService.DeleteFunction(functionId))
            {
                responser.Header.ReturnCode = 1;
                responser.Header.Message    = "Fail";
            }
            return(Json(responser));
        }
Exemple #2
0
        public void DeleteFunctionTest()
        {
            #region arrange (刪除成功)

            string id = "1";

            string reMessage = "";

            _functionBO.Stub(o => o.DeleteFunction(Arg <string> .Is.Anything)).Return(reMessage);

            #endregion

            #region act

            var result = _target.DeleteFunction(id);

            #endregion

            #region assert

            Assert.AreEqual(result, reMessage);

            #endregion
        }