public void test_doNotHaveAimTerminal() { //arrange AirTerminal airTerminal_1 = new AirTerminal(1); airTerminal_1.systemType = "空调送风"; AirTerminal airTerminal_2 = new AirTerminal(2); airTerminal_2.systemType = "空调回风"; AirTerminal airTerminal_3 = new AirTerminal(3); airTerminal_3.systemType = "排风"; List <AirTerminal> airTerminals = new List <AirTerminal>(); airTerminals.Add(airTerminal_1); airTerminals.Add(airTerminal_2); airTerminals.Add(airTerminal_3); string aimSystemType = "正压送风"; //act AirTerminal aimAirTerminal = assistantFunctions.GetAirTerminalOfCertainSystem(airTerminals, aimSystemType); //assert Assert.IsNull(aimAirTerminal); }
public void test_differentOrder() { //arrange AirTerminal airTerminal_1 = new AirTerminal(1); airTerminal_1.systemType = context.DataRow["第一个风口系统类型"].ToString(); AirTerminal airTerminal_2 = new AirTerminal(2); airTerminal_2.systemType = context.DataRow["第二个风口系统类型"].ToString(); AirTerminal airTerminal_3 = new AirTerminal(3); airTerminal_3.systemType = context.DataRow["第三个风口系统类型"].ToString(); List <AirTerminal> airTerminals = new List <AirTerminal>(); airTerminals.Add(airTerminal_1); airTerminals.Add(airTerminal_2); airTerminals.Add(airTerminal_3); string aimSystemType = context.DataRow["目标风口系统类型"].ToString(); int indexOfAimAirTerminals = Int32.Parse(context.DataRow["目标风口编号"].ToString()); //act AirTerminal aimAirTerminal = assistantFunctions.GetAirTerminalOfCertainSystem(airTerminals, aimSystemType); //assert Assert.IsNotNull(aimAirTerminal); Assert.AreEqual(aimSystemType, aimAirTerminal.systemType); Assert.AreEqual(indexOfAimAirTerminals, aimAirTerminal.Id); }
public void GetFanConnectingAirterminalTest() { string strhvacXdbPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//测试hvac.GDB"; HVACFunction.m_hvacXdbPath = strhvacXdbPath; AirTerminal airTerminal = new AirTerminal(1230487613874372609); Assert.IsTrue(HVACFunction.GetFanConnectingAirterminal(airTerminal).Count() > 0); }
public void GetRoomOfAirterminalTest() { string strArchPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//6.2.2-ARCH.GDB"; string strHVACPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//6.2.2-HVAC.GDB"; HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath); AirTerminal airterminal = new AirTerminal(1245195412197867521); Assert.IsTrue(HVACFunction.GetRoomOfAirterminal(airterminal).Id == 362159); }
public void test_AirTerminalsIsNull() { //arrange //act AirTerminal aimAirTerminal = assistantFunctions.GetAirTerminalOfCertainSystem(null, string.Empty); //assert Assert.IsNull(aimAirTerminal); }
public void test_getFloorDivisionOfAirTerminalsTopToBottom_pass() { using (ShimsContext.Create()) { FakeHVACFunction.roomSheetName_new = "房间"; FakeHVACFunction.ExcelPath_new = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\测试数据_GB51251_2017_3_3_1.xlsx"; HVAC_CheckEngine.Fakes.ShimHVACFunction.GetFloors = FakeHVACFunction.GetAllFLoorsOfBuilding_new; HVAC_CheckEngine.Fakes.ShimHVACFunction.GetRoomContainAirTerminalRoom = FakeHVACFunction.GetRoomContainAirTerminal_new; HVAC_CheckEngine.Fakes.ShimHVACFunction.GetRoomsString = FakeHVACFunction.GetRooms_new; //arrange List <Room> rooms = HVACFunction.GetRooms("防烟楼梯间"); List <AirTerminal> airTerminals = HVACFunction.GetRoomContainAirTerminal(rooms[4]); //打开测试数据文件 string importExcelPath = FakeHVACFunction.ExcelPath_new; //打开数据文件 IWorkbook workbook = WorkbookFactory.Create(importExcelPath); //读取数据表格 ISheet sheet_airTerminals = workbook.GetSheet("风口"); Dictionary <AirTerminal, List <Floor> > aimResult = new Dictionary <AirTerminal, List <Floor> >(); //依次读取数据行,并根据数据内容创建房间,并加入房间集合中 for (int index = 8; index <= 10; ++index) { IRow row = (IRow)sheet_airTerminals.GetRow(index); long airTerminalId = Convert.ToInt64(row.GetCell(sheet_airTerminals.getColNumber("ID")).NumericCellValue); AirTerminal airTerminal = new AirTerminal(airTerminalId); airTerminal.systemType = row.GetCell(sheet_airTerminals.getColNumber("系统类型")).ToString(); airTerminal.m_iStoryNo = Convert.ToInt32(row.GetCell(sheet_airTerminals.getColNumber("楼层编号")).NumericCellValue); string affordStoryIdString = row.GetCell(sheet_airTerminals.getColNumber("负担的楼层")).ToString(); List <Floor> floors = FakeHVACFunction.getAllFloorsByIdString(affordStoryIdString); aimResult[airTerminal] = floors; } //打开测试数据文件 //act Dictionary <AirTerminal, List <Floor> > result = assistantFunctions.getFloorDivisionOfAirTerminalsTopToBottom(assistantFunctions.filterFloorsBetweenlowestAndHighestm_iStoryNo(1, 15), airTerminals); //assert Custom_Assert.AreDictionaryEqual(aimResult, result); } }