public BaseResultModel <DicViewModel> GetDic(Guid?ID) { if (ID.IsNullOrEmpty()) { return(new ErrorResultModel <DicViewModel>(EnumErrorCode.请求参数错误, "参数不能为空")); } return(DicService.GetDic(ID)); }
public void GetDic_Test() { DicInputModel testModel = new DicInputModel() { DicValue = "测试DicValue", DicText = "测试DicText", }; BaseResultModel <DicOutputModel> insModelResult = DicService.ModifyDic(testModel); Assert.IsTrue(insModelResult.IsSuccess, insModelResult.ErrorMessage); BaseResultModel <DicViewModel> result = DicService.GetDic(insModelResult.Data.DicID); Assert.IsTrue(result.IsSuccess, result.ErrorMessage); BaseResultModel <int> delResult = DicService.DeleteDic(new List <Guid?>() { insModelResult.Data.DicID }); Assert.IsTrue(delResult.IsSuccess, delResult.ErrorMessage); }