public void TrackSystemMoveTest() { var ts = new Day13.TrackSystem(new string[] { "->--<-" }); // Just make sure the system does not crash ts.NextTick(out string crashCoordinate); Assert.AreEqual("", crashCoordinate); }
public void TrackSystemInitializeTest() { var ts = new Day13.TrackSystem(new string[] { "/-\\", "| |", "| v", "\\-/" }); Assert.AreEqual(10, ts.NumTracks); Assert.AreEqual(1, ts.NumCarts); }
public void TrackSystemCrashTest() { var ts = new Day13.TrackSystem(new string[] { " v", "/----/", "^ " }); string crashCoordinate; ts.NextTick(out crashCoordinate); Assert.AreEqual("", crashCoordinate); ts.NextTick(out crashCoordinate); Assert.AreEqual("", crashCoordinate); ts.NextTick(out crashCoordinate); Assert.AreEqual("", crashCoordinate); // Crash should happen in 3,1 eventhough 5,0 is the very first cart to move ts.NextTick(out crashCoordinate); Assert.AreEqual("3,1", crashCoordinate); }