Пример #1
0
        public void SetBasePriority()
        {
            var table = new PriorityTable();

            table.SetBasePriority(6);

            Console.WriteLine("Priority table with base priority = 6");
            for (int i = 0; i < 168; i++)
            {
                Console.WriteLine("Y = {0} ; Priority = {1}", i, table.GetPriorityAt(i));
            }

            table.GetPriorityAt(0).Should().Be(4);
            table.GetPriorityAt(5).Should().Be(4);
            table.GetPriorityAt(6).Should().Be(5);
            table.GetPriorityAt(22).Should().Be(5);
            table.GetPriorityAt(23).Should().Be(6);
            table.GetPriorityAt(38).Should().Be(6);
            table.GetPriorityAt(39).Should().Be(7);
            table.GetPriorityAt(54).Should().Be(7);
            table.GetPriorityAt(55).Should().Be(8);
            table.GetPriorityAt(70).Should().Be(8);
            table.GetPriorityAt(71).Should().Be(9);
            table.GetPriorityAt(86).Should().Be(9);
            table.GetPriorityAt(87).Should().Be(10);
            table.GetPriorityAt(103).Should().Be(10);
            table.GetPriorityAt(104).Should().Be(11);
            table.GetPriorityAt(119).Should().Be(11);
            table.GetPriorityAt(120).Should().Be(12);
            table.GetPriorityAt(135).Should().Be(12);
            table.GetPriorityAt(136).Should().Be(13);
            table.GetPriorityAt(151).Should().Be(13);
            table.GetPriorityAt(152).Should().Be(14);
            table.GetPriorityAt(167).Should().Be(14);
        }