Ejemplo n.º 1
0
        public void GetNumber10_Should_Equal10()
        {
            var testLinkedList = new DirectionLinkedList <int>();

            testLinkedList.InsertLast(1);
            testLinkedList.InsertLast(10);
            testLinkedList.InsertLast(100);

            var node = testLinkedList.GetNodeByKey(10);

            Assert.AreEqual(10, node.value);
        }
Ejemplo n.º 2
0
 /// <summary>Initializes a new instance of the <see cref="Robot"/> class.</summary>
 /// <param name="x"> x coordinate</param>
 /// <param name="y"> y coordinate</param>
 /// <param name="direction"> default robot direction.</param>
 /// <param name="boundary"> map boundary.</param>
 public Robot(int x, int y, DirectionEnum direction, Boundary boundary)
 {
     DirectionList = new DirectionLinkedList <DirectionEnum>(
         new List <DirectionEnum>()
     {
         DirectionEnum.NORTH,
         DirectionEnum.EAST,
         DirectionEnum.SOUTH,
         DirectionEnum.WEST,
     });
     position      = new Position(x, y);
     Direction     = DirectionList.GetNodeByKey(direction);
     this.boundary = boundary;
 }