public void GetRoomsMoreThanTest()
        {
            string strArchPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";

            HVACFunction.m_archXdbPath = strArchPath;
            Assert.IsTrue(HVACFunction.GetRoomsMoreThan("走廊", 10.0).Count() > 0);
        }
        public void isOuterAirTerminal_test()
        {
            string       strArchPath  = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\xdb\isOuterAirTerminal_test\建筑模型.XDB";
            string       strHVACPath  = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\xdb\isOuterAirTerminal_test\机电模型.GDB";
            HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath);
            //arrange
            List <AirTerminal> airTerminals = HVACFunction.GetAirterminals();


            //act
            //assert
            foreach (AirTerminal airTerminal in airTerminals)
            {
                if (airTerminal.Id == 1254703607509417984)
                {
                    Assert.IsFalse(HVACFunction.isOuterAirTerminal(airTerminal));
                }
                else if (airTerminal.Id == 1254703607538778113)
                {
                    Assert.IsFalse(HVACFunction.isOuterAirTerminal(airTerminal));
                }
                else if (airTerminal.Id == 1254703607475863552)
                {
                    Assert.IsTrue(HVACFunction.isOuterAirTerminal(airTerminal));
                }
                else if (airTerminal.Id == 1254703607379394560)
                {
                    Assert.IsTrue(HVACFunction.isOuterAirTerminal(airTerminal));
                }
            }
        }
        public void test_getAffordHeightOfFanTopToBottom_test_pass()
        {
            using (ShimsContext.Create())
            {
                FakeHVACFunction.ExcelPath_new = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\测试数据_GB51251_2017_3_3_1.xlsx";

                FakeHVACFunction.roomSheetName_new = "房间";


                HVAC_CheckEngine.Fakes.ShimHVACFunction.GetFloors = FakeHVACFunction.GetAllFLoorsOfBuilding_new;

                HVAC_CheckEngine.Fakes.ShimHVACFunction.GetRoomContainAirTerminalRoom = FakeHVACFunction.GetRoomContainAirTerminal_new;

                HVAC_CheckEngine.Fakes.ShimHVACFunction.GetRoomsString = FakeHVACFunction.GetRooms_new;

                HVAC_CheckEngine.Fakes.ShimHVACFunction.GetOutletsOfFanFan = FakeHVACFunction.GetOutputLetsOfFan_new;

                HVAC_CheckEngine.Fakes.ShimHVACFunction.GetHighestStoryNoOfRoomRoom = FakeHVACFunction.getHighestStoryNoOfRoom_new;
                //arrange



                //打开测试数据文件
                string importExcelPath = FakeHVACFunction.ExcelPath_new;
                //打开数据文件
                IWorkbook workbook = WorkbookFactory.Create(importExcelPath);
                //读取数据表格
                ISheet sheet_fans = workbook.GetSheet("风机");

                Dictionary <AirTerminal, List <Floor> > aimResult = new Dictionary <AirTerminal, List <Floor> >();

                Fan fan = new Fan(10);

                double aimHight = 90000;
                //打开测试数据文件
                //act
                ISheet sheet_rooms = workbook.GetSheet("房间");
                IRow   row         = (IRow)sheet_rooms.GetRow(4);
                Room   stairCase   = new Room(4);


                stairCase.type              = row.GetCell(sheet_rooms.getColNumber("房间类型")).StringCellValue;
                stairCase.name              = row.GetCell(sheet_rooms.getColNumber("房间名称")).StringCellValue;
                stairCase.m_dArea           = row.GetCell(sheet_rooms.getColNumber("房间面积")).NumericCellValue;
                stairCase.m_eRoomPosition   = (RoomPosition)row.GetCell(sheet_rooms.getColNumber("房间位置")).NumericCellValue;
                stairCase.m_iNumberOfPeople = (int)row.GetCell(sheet_rooms.getColNumber("房间人数")).NumericCellValue;
                stairCase.m_iStoryNo        = (int)row.GetCell(sheet_rooms.getColNumber("房间楼层编号")).NumericCellValue;
                List <AirTerminal> airTerminals = HVACFunction.GetRoomContainAirTerminal(stairCase);

                int          highestm_iStoryNo = HVACFunction.GetHighestStoryNoOfRoom(stairCase);
                int          lowestm_iStoryNo  = stairCase.m_iStoryNo.Value;
                List <Floor> floors            = assistantFunctions.filterFloorsBetweenlowestAndHighestm_iStoryNo(lowestm_iStoryNo, highestm_iStoryNo);

                double hight = assistantFunctions.getAffordHeightOfFanByFloorDivision(fan, assistantFunctions.getFloorDivisionOfAirTerminalsTopToBottom(floors, airTerminals));

                //assert

                Assert.AreEqual(aimHight, hight);
            }
        }
        public void GetRoomsContainingStringTest()
        {
            string strArchPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";

            HVACFunction.m_archXdbPath = strArchPath;
            Assert.IsTrue(HVACFunction.GetRoomsContainingString("CH").Count() > 0);
        }
        public void GetRoomsTest1()
        {
            //  string strArchPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";
            string strArchPath = "C://Users//zheny//Documents//WXWork//1688853814885410//Cache//File//2020-05//建筑模型.XDB";

            HVACFunction.m_archXdbPath = strArchPath;
            Assert.IsTrue(HVACFunction.GetRooms("前室").Count() > 0);
        }
        public void GetAreaTest()
        {
            Window window      = new Window(322);
            string strArchPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";

            HVACFunction.m_archXdbPath = strArchPath;
            Assert.IsTrue(HVACFunction.GetArea(window) > 0);
        }
        public void isOvergroundRoomTest()
        {
            Room   room        = new Room(573789);
            string strArchPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";

            HVACFunction.m_archXdbPath = strArchPath;
            Assert.IsTrue(HVACFunction.isOvergroundRoom(room));
        }
 public void GetBranchDamperDuctsTest()
 {
     string       strArchPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//6.2.2-ARCH.XDB";
     string       strHVACPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//6.2.2-paiyanHVAC.XDB";
     HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath);
     List <Duct>  ducts        = HVACFunction.GetBranchDamperDucts();
     //Assert.Fail();
 }
        public void GetConnectedRegionTest()
        {
            HVACFunction.m_archXdbPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";
            List <Region> regions = new List <Region>();

            regions = HVACFunction.GetConnectedRegion();
            Assert.IsTrue(regions.Count() > 0);
        }
        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 GetDuctsCrossSpaceTest()
        {
            string       strArchPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";
            string       strHVACPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//机电.GDB";
            HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath);
            Room         room         = new Room(573789);

            Assert.IsTrue(HVACFunction.GetDuctsCrossSpace(room).Count() > 0);
        }
        public void GetFireDistrictLengthTest()
        {
            SmokeCompartment fireDis = new SmokeCompartment(573789);
            double           dLength = 0.0;

            HVACFunction.m_archXdbPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";
            dLength = HVACFunction.GetSmokeCompartmentLength(fireDis);
            Assert.IsTrue(dLength > 0);
        }
        public void isAllBranchLinkingAirTerminalTest()
        {
            string strhvacXdbPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//测试hvac.GDB";

            HVACFunction.m_hvacXdbPath = strhvacXdbPath;
            Fan fan = new Fan(1230487612968402944);

            Assert.IsTrue(HVACFunction.isAllBranchLinkingAirTerminal(fan));
        }
        public void GetDuctsCrossFireDistrictTest()
        {
            string          strArchPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";
            string          strHVACPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//机电.GDB";
            HVACFunction    hvacFunction = new HVACFunction(strArchPath, strHVACPath);
            FireCompartment fireDistrict = new FireCompartment(573789);

            Assert.IsTrue(HVACFunction.GetDuctsCrossFireDistrict(fireDistrict).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 GetDuctsOfFanTest()
        {
            Fan          fan          = new Fan(1244249984593821696);
            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);
            List <Duct>  ducts        = HVACFunction.GetDuctsOfFan(fan);

            Assert.IsTrue(ducts.Count() > 0);
        }
        public void GetWindowsInRoomTest()
        {
            string strArchPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//8.1.3.GDB";

            HVACFunction.m_archXdbPath = strArchPath;
            Room room   = new Room(362135);
            int  iCount = HVACFunction.GetWindowsInRoom(room).Count();

            Assert.IsTrue(HVACFunction.GetWindowsInRoom(room).Count() > 0);
        }
        public void GetFloorsTest()
        {
            string       strArchPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";
            string       strHVACPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//6.2.2-HVAC.GDB";
            HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath);

            List <Floor> floors = HVACFunction.GetFloors();

            Assert.IsTrue(floors.Count > 0);
        }
        public void GetInletOfFanTest()
        {
            string strhvacXdbPath = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//测试hvac.GDB";

            HVACFunction.m_hvacXdbPath = strhvacXdbPath;
            Fan fan = new Fan(1230487612968402944);

            Assert.IsTrue(HVACFunction.GetInletsOfFan(fan).Count() > 0);
            //Assert.IsTrue(false);
        }
        public void GetRoomContainAirTerminalTest()
        {
            Room               room         = new Room(362159);
            string             strArchPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//6.2.2-ARCH.XDB";
            string             strHVACPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//6.2.2-HVAC.XDB";
            HVACFunction       hvacFunction = new HVACFunction(strArchPath, strHVACPath);
            List <AirTerminal> airTerminals = HVACFunction.GetRoomContainAirTerminal(room);

            Assert.IsTrue(airTerminals.Count() > 0);
        }
        public void GetAllVerticalDuctConnectedToDuctTest()
        {
            Duct         duct         = new Duct(1244249984656736257);
            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);
            List <Duct>  ducts        = HVACFunction.GetAllVerticalDuctConnectedToDuct(duct);

            Assert.IsTrue(ducts.Count() > 0);
        }
        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 GetRoomsTest()
        {
            string       type         = "间";
            string       name         = "CH/PH Stock 1";
            double       area         = 10.0;
            RoomPosition roomPosition = RoomPosition.overground;

            string       strArchPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//建筑.GDB";
            string       strHVACPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//机电.GDB";
            HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath);

            HVACFunction.GetRooms(type, name, area, roomPosition);
        }
Beispiel #24
0
        public void GB51251_2017_3_2_2Test()
        {
            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);
            BimReview    result       = new BimReview();

            result = HVACChecker.GB51251_2017_3_2_2();

            //assert
            // Assert.AreEqual(comment, result.comment);
            Assert.IsFalse(result.isPassCheck);
        }
Beispiel #25
0
        public void GB50041_2008_15_3_7Test()
        {
            string       strArchPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//442.XDB";
            string       strHVACPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//442hvac.XDB";
            HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath);
            BimReview    result       = new BimReview();

            result = HVACChecker.GB50041_2008_15_3_7();

            string comment = "设计满足规范GB50016_2014中第8.5.3条条文规定。";

            Assert.AreEqual(comment, result.comment);
            Assert.IsFalse(result.isPassCheck);
        }
Beispiel #26
0
        public void GB51251_2017_4_2_4Test1()
        {
            string       strArchPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//424ARCH.XDB";
            string       strHVACPath  = "D://Users//zheny//Source//Repos//HVAC-Checker//HVAC-Checker//8_5_4-HVAC.XDB";
            HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath);
            BimReview    result       = new BimReview();

            result = HVACChecker.GB51251_2017_4_2_4();

            string comment = "设计满足规范GB50016_2014中第8.5.3条条文规定。";

            Assert.AreEqual(comment, result.comment);
            Assert.IsFalse(result.isPassCheck);
        }
        public void GetAllRoomsInCertainStory_test()
        {
            string       strArchPath  = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\xdb\getRoomInCertainStorey_test\建筑模型.XDB";
            string       strHVACPath  = @"";
            HVACFunction hvacFunction = new HVACFunction(strArchPath, strHVACPath);
            //arrange
            Room room_1 = new Room(726561);
            Room room_2 = new Room(726564);


            //act
            List <Room> rooms = HVACFunction.GetAllRoomsInCertainStorey(1);

            //assert
            Assert.IsTrue(rooms.Exists(x => x.Id == 726561));
            Assert.IsTrue(rooms.Exists(x => x.Id == 726564));
        }
Beispiel #28
0
        static void Main(string[] args)
        {
            //try
            //{
            string       pathOfBuildingXDB   = args[0];
            string       pathOfMechanicalXDB = args[1];
            HVACFunction function            = new HVACFunction(pathOfBuildingXDB, pathOfMechanicalXDB);
            string       result = runChecher();

            Console.WriteLine(result);
            Console.ReadLine();
            //}
            //catch(Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //    Console.ReadLine();
            //}
        }
Beispiel #29
0
 private void button_Ok_Click(object sender, EventArgs e)
 {
     if (archXDB_FileName == null && mechXDB_FileName == null)
     {
         MessageBox.Show("未指定XDB文件路径");
     }
     else if (standardCode == null || itemCode == null)
     {
         MessageBox.Show("未指定要审查的条文");
     }
     else
     {
         Visible = false;
         HVACFunction    hvacFunction    = new HVACFunction(archXDB_FileName, mechXDB_FileName);
         BimReview       result          = runChecker(standardCode, itemCode);
         Form_showResult form_showResult = new Form_showResult();
         form_showResult.showResult(result);
         form_showResult.ShowDialog();
         Visible = true;
     }
 }
        public void IsEquipmentChimneyHasFlexibleShortTubeTest_pass()
        {
            string         strArchPath  = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\xdb\GB50736_2012_6_6_13\建筑模型.XDB";
            string         strHVACPath  = @"D:\wangT\HVAC-Checker\UnitTestHVACChecker\测试数据\xdb\GB50736_2012_6_6_13\机电模型_Pass.XDB";
            HVACFunction   hvacFunction = new HVACFunction(strArchPath, strHVACPath);
            List <Element> equipments   = new List <Element>();

            equipments.AddRange(HVACFunction.GetAllAbsorptionChillers());
            equipments.AddRange(HVACFunction.GetAllBoilers());

            bool isAllEquipmentChimneyHasFlexibleShortTube = true;

            foreach (Element equipment in equipments)
            {
                if (!HVACFunction.IsEquipmentChimneyHasFlexibleShortTube(equipment))
                {
                    isAllEquipmentChimneyHasFlexibleShortTube = false;
                    break;
                }
            }

            Assert.IsTrue(isAllEquipmentChimneyHasFlexibleShortTube);
        }