Exemplo n.º 1
0
        public void TestGetBusIdsSorted()
        {
            List <int> busList      = ShuttleSearcher.GetBusList(this.testData);
            List <int> expectedList = busList;

            expectedList.Sort();
            Assert.AreEqual(expectedList, busList);
        }
Exemplo n.º 2
0
        public void TestGetBusIds()
        {
            var expectedBusList = new List <int> {
                7, 13, 19, 31, 59
            };
            List <int> busList = ShuttleSearcher.GetBusList(this.testData);

            Assert.AreEqual(5, busList.Count);
            Assert.AreEqual(expectedBusList, busList);
        }
Exemplo n.º 3
0
        public void TestEarliestDeparture()
        {
            var localTestData  = this.testData;
            int startTimestamp = int.Parse(localTestData[0]);
            var busList        = ShuttleSearcher.GetBusList(localTestData);

            (int departure, int waitTime, int busId) = ShuttleSearcher.EarliestDeparture(startTimestamp, busList);
            Assert.AreEqual(5, waitTime);
            Assert.AreEqual(944, departure);
            Assert.AreEqual(59, busId);
        }
Exemplo n.º 4
0
        public void FindAnswerDayThirteenPuzzleOne()
        {
            var localTestData  = this.inputData;
            int startTimestamp = int.Parse(localTestData[0]);
            var busList        = ShuttleSearcher.GetBusList(localTestData);

            (int departure, int waitTime, int busId) = ShuttleSearcher.EarliestDeparture(startTimestamp, busList);
            Assert.AreEqual(296, waitTime * busId);
            Assert.AreEqual(8, waitTime);
            Assert.AreEqual(1000517, departure);
            Assert.AreEqual(37, busId);
        }