public void TestUpdateAcceptanceList() { Tools.UserCaseHandle userCaseHandle = new Tools.UserCaseHandle(@"C:\Users\Mr.Feng\Desktop\软工\测试用例\Update_AcceptanceList.xls"); IEnumerable acceptanceList = userCaseHandle.GetUserCases(); List <string> errorList = new List <string>(); foreach (var i in acceptanceList) { Assert.AreEqual(false, interviewBll.UpdateAcceptanceList((AcceptanceList)i, ref errorList)); } int maxId = -1; foreach (AcceptanceList i in interviewBll.GetAllAcceptanceListArray()) { if (i.Id > maxId) { maxId = i.Id; } } if (maxId != -1) { AcceptanceList list = new AcceptanceList() { Id = maxId, OrderId = 10, AcceptorId = 200, State = "已编目", }; Assert.AreEqual(true, interviewBll.UpdateAcceptanceList(list, ref errorList)); } }
public void AddInterviewCatalogTest() { //Tools.UserCaseHandle userCaseHandle = new Tools.UserCaseHandle(@"E:\大三课程文档汇总\软件工程\FunctionTest\Add_CatalogFormList.xls"); //IEnumerable interviewCatalog = userCaseHandle.GetUserCases(); List <string> errorList = new List <string>(); InterviewCatalog interview1 = new InterviewCatalog() { Id = 1, InterviewId = 1, State = "", }; Assert.AreEqual(false, createCatalogBll.AddInterviewCatalog(interview1, ref errorList)); int maxId = -1; foreach (AcceptanceList i in interviewBll.GetAllAcceptanceListArray()) { if (i.Id > maxId) { maxId = i.Id; } } InterviewCatalog list = new InterviewCatalog() { Id = 1, InterviewId = maxId, State = "可编目", }; Assert.AreEqual(true, createCatalogBll.AddInterviewCatalog(list, ref errorList)); }