Example #1
0
        public void TestTotalHouses()
        {
            CreateHouseImage testCreateHouse = new CreateHouseImage();

            // Исходнве данные
            ProjectInfo sp = GetSpotInformation();


            // схема проекта
            ProjectScheme projectSpot = new ProjectScheme(sp);

            // Чтение файла схемы объекта
            projectSpot.ReadScheme();

            // Получение всех домов
            Stopwatch timer = new Stopwatch();

            timer.Start();

            var totalHouses = projectSpot.GetTotalHouses(0, 0);

            timer.Stop();
            Console.WriteLine("Получение всех домов = " + timer.Elapsed.TotalSeconds);

            Console.WriteLine($"Пятен = {totalHouses.Count}; Домов = {totalHouses.Sum(s => s.Count)} - {string.Join(",", totalHouses.Select(t => t.Count))}");

            Console.WriteLine($"{string.Join("; ", totalHouses.Select(h=>h[0].SectionsBySize[0].SpotOwner + " домов=" +  h.Count))}");
            testCreateHouse.TestCreateImage(totalHouses);//, new List<List<int>> { new List<int> { 9,14,9,12 } });
        }
Example #2
0
        public void TestTotalHouses()
        {
            // Исходнве данные
            string insolationFile       = @"c:\work\test\АР\ЖУКИ\Задание по инсоляции ПИК1.xlsx";
            List <HouseOptions> options = new List <HouseOptions>()
            {
                new HouseOptions("P1", 15, 25, new List <bool> {
                    false, false, false, false, true
                }),
                new HouseOptions("P2", 15, 25, new List <bool> {
                    false, false, false, false, true
                })
            };
            SpotInfo sp = GetSpotInformation();

            // схема проекта
            ProjectScheme projectSpot = new ProjectScheme(options, sp);

            // Чтение файла схемы объекта
            projectSpot.ReadScheme(insolationFile);
            // Получение всех домов
            var totalHouses = projectSpot.GetTotalHouses();

            foreach (var hs in totalHouses)
            {
                foreach (var house in hs)
                {
                    CreateHouseImage.TestCreateImage(house);
                }
            }

            Assert.AreEqual(totalHouses.Count, 2);
        }