public void IsCoordinateOutTest()
        {
            // Arrange
            var coordinate = new _2DCoordinate(5, 1);

            // Act
            var result = _grid.IsCoordinateWithin(coordinate);

            // Assert
            Assert.IsFalse(result);
        }
        public void IsCoordinateWithinTest()
        {
            // Arrange
            var coordinate = new _2DCoordinate(3, 5);

            // Act
            var result = _grid.IsCoordinateWithin(coordinate);

            // Assert
            Assert.IsTrue(result);
        }
        public void IsCoordinateScent()
        {
            // Arrange
            var coordinate = new _2DCoordinate(3, 5);

            // Act
            _grid.ScenteCoordinate(coordinate);
            var result = _grid.IsCoordinateScented(coordinate);

            // Assert
            Assert.IsTrue(result);
        }
        public void IsCoordinateNotScent()
        {
            // Arrange
            var coordinate = new _2DCoordinate(5, 1);

            // Act
            _grid.ScenteCoordinate(coordinate);
            var result = _grid.IsCoordinateScented(coordinate);

            // Assert
            Assert.IsFalse(result);
        }
        public void IsRobotNotAddedOnPoint()
        {
            // Arrange
            var coordinate = new _2DCoordinate(5, 1);
            var robot      = new SimpleMartianRobot(coordinate, new _2DDirection(0), _grid);

            // Act
            _grid.AddRobotOnPoint(robot);
            var robotSet = _grid.AcquireRobot(coordinate);

            // Assert
            Assert.IsNull(robotSet);
        }
        public void IsRobotRemovedPoint()
        {
            // Arrange
            var coordinate = new _2DCoordinate(3, 5);
            var robot      = new SimpleMartianRobot(coordinate, new _2DDirection(0), _grid);

            // Act
            _grid.AddRobotOnPoint(robot);
            var robotSet = _grid.AcquireRobot(coordinate);

            _grid.RemoveRobotFromPoint(robot);
            var robotDel = _grid.AcquireRobot(coordinate);

            // Assert
            Assert.AreNotEqual(robotDel, robotSet);
        }
Beispiel #7
0
 public void Setup()
 {
     _coordinate = new _2DCoordinate(4, 1);
     _grid       = new RectangularGrid(4, 7);
     _robot      = new SimpleMartianRobot(_coordinate, new _2DDirection(90), _grid);
 }