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);
            }
        }
        public void test_getDoorsToCorridorOfAtria_pass()
        {
            using (ShimsContext.Create())
            {
                HVAC_CheckEngine.Fakes.ShimHVACFunction.GetDoorsBetweenTwoRoomsRoomRoom = FakeHVACFunction.getDoorsBetweenTwoRooms_new;

                HVAC_CheckEngine.Fakes.ShimHVACFunction.GetConnectedRoomsRoom = FakeHVACFunction.getConnectedRooms_new;
                //arrange
                FakeHVACFunction.ExcelPath_new = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\测试数据_GB51251_2017_3_1_5.xlsx";
                Room        atria       = new Room(21);
                List <Door> expectDoors = new List <Door>();
                expectDoors.Add(new Door(20));
                expectDoors.Add(new Door(21));
                //打开测试数据文件
                //act
                List <Door> doors = assistantFunctions.getDoorsToCorridorOfAtria(atria);

                //assert

                Custom_Assert.AreListsEqual(expectDoors, doors);
            }
        }
        public void test_exceptSomeRooms_largerAndEqual_smallerAndEqual_test_pass()
        {
            using (ShimsContext.Create())
            {
                FakeHVACFunction.ExcelPath_new     = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\测试数据_exceptSomeRoom.xlsx";
                FakeHVACFunction.roomSheetName_new = "房间(包含需要除去的房间大于等于小于等于)";
                HVAC_CheckEngine.Fakes.ShimHVACFunction.GetRoomsString = FakeHVACFunction.GetRooms_new;
                //arrange

                //打开测试数据文件
                string importExcelPath = FakeHVACFunction.ExcelPath_new;
                //打开数据文件
                IWorkbook workbook = WorkbookFactory.Create(importExcelPath);
                //读取数据表格
                ISheet sheet_rooms = workbook.GetSheet("房间(包含需要除去的房间大于等于小于等于)");

                List <Room> aimRooms = new List <Room>();
                //依次读取数据行,并根据数据内容创建房间,并加入房间集合中
                for (int index = 1; index <= sheet_rooms.LastRowNum; ++index)
                {
                    IRow row          = (IRow)sheet_rooms.GetRow(index);
                    bool isNeededRoom = row.GetCell(sheet_rooms.getColNumber("是否需要")).BooleanCellValue;
                    if (isNeededRoom)
                    {
                        long Id   = Convert.ToInt64(row.GetCell(sheet_rooms.getColNumber("ID")).ToString());
                        Room room = new Room(Id);
                        room.type              = row.GetCell(sheet_rooms.getColNumber("房间类型")).StringCellValue;
                        room.name              = row.GetCell(sheet_rooms.getColNumber("房间名称")).StringCellValue;
                        room.m_dArea           = row.GetCell(sheet_rooms.getColNumber("房间面积")).NumericCellValue;
                        room.m_eRoomPosition   = (RoomPosition)row.GetCell(sheet_rooms.getColNumber("房间位置")).NumericCellValue;
                        room.m_iNumberOfPeople = (int)row.GetCell(sheet_rooms.getColNumber("房间人数")).NumericCellValue;
                        room.m_iStoryNo        = (int)row.GetCell(sheet_rooms.getColNumber("房间楼层编号")).NumericCellValue;
                        aimRooms.Add(room);
                    }
                }
                //act
                List <Room> rooms = HVACFunction.GetRooms("");

                List <assistantFunctions.exceptRoomCondition> conditions = new List <assistantFunctions.exceptRoomCondition>();
                assistantFunctions.exceptRoomCondition        overgroundCorridorCondition = new assistantFunctions.exceptRoomCondition();
                overgroundCorridorCondition.area         = 0;
                overgroundCorridorCondition.type         = "走廊";
                overgroundCorridorCondition.name         = "";
                overgroundCorridorCondition.roomPosition = RoomPosition.overground;
                overgroundCorridorCondition.areaType     = assistantFunctions.exceptRoomCondition.AreaType.LargerAndEqualThan;
                conditions.Add(overgroundCorridorCondition);

                assistantFunctions.exceptRoomCondition overgroundSmallerThan500sqmCondition = new assistantFunctions.exceptRoomCondition();
                overgroundSmallerThan500sqmCondition.area         = 500;
                overgroundSmallerThan500sqmCondition.type         = "";
                overgroundSmallerThan500sqmCondition.name         = "";
                overgroundSmallerThan500sqmCondition.roomPosition = RoomPosition.overground;
                overgroundSmallerThan500sqmCondition.areaType     = assistantFunctions.exceptRoomCondition.AreaType.SmallerAndEqualThan;
                conditions.Add(overgroundSmallerThan500sqmCondition);

                rooms = rooms.exceptSomeRooms(conditions);

                //assert

                Custom_Assert.AreListsEqual(aimRooms, rooms);
            }
        }