public void QueryRecordTest() { // string ConnectionString = string.Empty; // TODO: 初始化为适当的值 DBLendingInfo target = new DBLendingInfo(connstr); // TODO: 初始化为适当的值 GoodsQueryParam GoodsQueryParamact = null; // TODO: 初始化为适当的值 //定义参数 GoodsQueryParamact = new GoodsQueryParam(); GoodsQueryParamact.nLendingNumber = -1; GoodsQueryParamact.nLendingType = 0; GoodsQueryParamact.nReturnState = 0; GoodsQueryParamact.strTrainmanName = "张勇"; GoodsQueryParamact.strTrainmanNumber = "2300679"; GoodsQueryParamact.strWorkShopGUID = "3b50bf66-dabb-48c0-8b6d-05db80591090"; GoodsQueryParamact.dtBeginTime = DateTime.Today.AddDays(-30); GoodsQueryParamact.dtEndTime = DateTime.Today; List <LendingInfo> expected = null; // TODO: 初始化为适当的值 List <LendingInfo> actual; actual = target.QueryRecord(GoodsQueryParamact); Assert.IsNotNull(actual); //Assert.AreEqual(expected, actual); // Assert.Inconclusive("验证此测试方法的正确性。"); }
public Get_OutIsHaveNotReturnGoods IsHaveNotReturnGoods(string data) { Get_OutIsHaveNotReturnGoods json = new Get_OutIsHaveNotReturnGoods(); try { Get_InIsHaveNotReturnGoods input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InIsHaveNotReturnGoods>(data); DBLendingInfo db = new DBLendingInfo(ConData.WebSiteConnectionString); Results r = new Results(); r.result = db.IsHaveNotReturnGoods(input.TrainmanGUID); if (r.result) { json.data = r; json.result = "0"; json.resultStr = "返回成功"; } else { json.result = "1"; json.resultStr = "提交失败:"; } } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }
public void DBLendingInfoConstructorTest() { // string ConnectionString = string.Empty; // TODO: 初始化为适当的值 DBLendingInfo target = new DBLendingInfo(connstr); Assert.IsNotNull(target); //Assert.Inconclusive("TODO: 实现用来验证目标的代码"); }
/// <summary> ///QueryRecord_DTToList 的测试 ///</summary> // [Test] public void QueryRecord_DTToListTest() { // string ConnectionString = string.Empty; // TODO: 初始化为适当的值 DBLendingInfo target = new DBLendingInfo(connstr); // TODO: 初始化为适当的值 DataTable dt = null; // TODO: 初始化为适当的值 List <LendingInfo> expected = null; // TODO: 初始化为适当的值 List <LendingInfo> actual; actual = target.QueryRecord_DTToList(dt); Assert.AreEqual(expected, actual); // Assert.Inconclusive("验证此测试方法的正确性。"); }
public void IsHaveNotReturnGoodsTest() { // string ConnectionString = string.Empty; // TODO: 初始化为适当的值 DBLendingInfo target = new DBLendingInfo(connstr); // TODO: 初始化为适当的值 string TrainmanGUID = string.Empty; // TODO: 初始化为适当的值 TrainmanGUID = "2305966"; bool expected = true; // TODO: 初始化为适当的值 bool actual; actual = target.IsHaveNotReturnGoods(TrainmanGUID); Assert.IsTrue(actual); Assert.AreEqual(expected, actual); // Assert.Inconclusive("验证此测试方法的正确性。"); }
public void DeleteGoodsTest() { // string ConnectionString = string.Empty; // TODO: 初始化为适当的值 DBLendingInfo target = new DBLendingInfo(connstr); // TODO: 初始化为适当的值 int LendingType = 0; // TODO: 初始化为适当的值 string LendingExInfo = string.Empty; // TODO: 初始化为适当的值 string WorkShopGUID = string.Empty; // TODO: 初始化为适当的值 LendingExInfo = "532"; WorkShopGUID = "3b50bf66-dabb-48c0-8b6d-05db80591090"; target.DeleteGoods(LendingType, LendingExInfo, WorkShopGUID); Assert.IsNotNull(target); // Assert.Inconclusive("无法验证不返回值的方法。"); }
public Get_OutQueryRecord QueryRecord(string data) { Get_OutQueryRecord json = new Get_OutQueryRecord(); try { Get_InQueryRecord input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InQueryRecord>(data); RlendingInfoList R = new RlendingInfoList(); DBLendingInfo db = new DBLendingInfo(ConData.WebSiteConnectionString); R.lendingInfoList = db.QueryRecord(input.queryParam); json.data = R; json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }