public void TestCountSeats() { var seats = SeatSimulator.CountSeats(this.testData); Assert.AreEqual(0, seats.occupied); Assert.AreEqual(71, seats.free); }
public void Setup() { var seatSim = new SeatSimulator(); this.testData = seatSim.GetInputDataMap(FilePathTestData); this.inputData = seatSim.GetInputDataMap(FilePathInputData); }
public void TestSimulate(int simulationSteps, int expectedOccupied) { var seats = SeatSimulator.Simulate(this.testData, simulationSteps); int expectedFree = 71 - expectedOccupied; Assert.AreEqual(expectedOccupied, seats.occupied); Assert.AreEqual(expectedFree, seats.free); }
public void TestSimulateToSteadyState() { int expectedOccupied = 37; var seats = SeatSimulator.Simulate(this.testData); int expectedFree = 71 - expectedOccupied; Assert.AreEqual(expectedOccupied, seats.occupied); Assert.AreEqual(expectedFree, seats.free); }
public void TestAdjacentSeats() { var seats = SeatSimulator.AdjacentSeats(this.testData, 0, 0); var expectedSeats = new List <char> { 'L', '.', 'L', 'L' }; Assert.AreEqual(4, seats.Count); Assert.AreEqual(expectedSeats, seats); }
public void FindAnswerDayElevenPuzzleOne() { var seats = SeatSimulator.Simulate(this.inputData); Assert.AreEqual(2334, seats.occupied); }