public void TestGetBusIdsSorted() { List <int> busList = ShuttleSearcher.GetBusList(this.testData); List <int> expectedList = busList; expectedList.Sort(); Assert.AreEqual(expectedList, busList); }
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); }
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); }
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); }
public void TestNextDeparture(int startTimestamp, int busId, int expectedDeparture) { int departure = ShuttleSearcher.NextDeparture(startTimestamp, busId); Assert.AreEqual(expectedDeparture, departure); }
public void Setup() { this.testData = ShuttleSearcher.ReadFileAsArray(FilePathTestData); this.inputData = ShuttleSearcher.ReadFileAsArray(FilePathInputData); }