public void UpdateDirection_NotMultiplesOf90() { var robot = new Robot(); Assert.IsTrue(robot.UpdateDirection(1).Direction == 0); Assert.IsTrue(robot.UpdateDirection(45).Direction == 0); Assert.IsTrue(robot.UpdateDirection(91).Direction == 1); Assert.IsTrue(robot.UpdateDirection(179).Direction == 2); Assert.IsTrue(robot.UpdateDirection(181).Direction == 0); Assert.IsTrue(robot.UpdateDirection(361).Direction == 0); Assert.IsTrue(robot.UpdateDirection(271).Direction == 3); Assert.IsTrue(robot.UpdateDirection(316).Direction == 2); }
public void UpdateDirection_MultiplesOf90() { var robot = new Robot(); Assert.IsTrue(robot.UpdateDirection(0).Direction == 0); Assert.IsTrue(robot.UpdateDirection(90).Direction == 1); Assert.IsTrue(robot.UpdateDirection(90).Direction == 2); Assert.IsTrue(robot.UpdateDirection(180).Direction == 0); Assert.IsTrue(robot.UpdateDirection(360).Direction == 0); Assert.IsTrue(robot.UpdateDirection(180).Direction == 2); Assert.IsTrue(robot.UpdateDirection(270).Direction == 1); }