Пример #1
0
        //[DataRow(0, 3, 2, 5)]
        //[DataRow(2, 6, 3, 3)]
        //[DataRow(7, 3, 1, 1)]
        //[DataRow(0, 0, 5, 0)]
        public void CheckRoverPositionTest_NotAllowedPositions(int lon1, int lat1, int lon2, int lat2)
        {
            _roverModel.PlateauSizeLongitude = 5;
            _roverModel.PlateauSizeLatitude  = 5;

            _roverModel.Rover1.Position.Longitude = lon1;
            _roverModel.Rover1.Position.Latitude  = lat1;

            _roverModel.Rover2.Position.Longitude = lon2;
            _roverModel.Rover2.Position.Latitude  = lat2;

            _roverMovement = new RoverMovement(_roverModel);

            bool valid = false;

            try
            {
                valid = _roverMovement.CheckRoverPositionsAllowed();
            }
            catch (System.Exception)
            {
            }

            Assert.IsFalse(valid);
        }
Пример #2
0
        public void CheckRoverPositionTest_AllowedPositions(int lon1, int lat1, int lon2, int lat2)
        {
            _roverModel.PlateauSizeLongitude = 5;
            _roverModel.PlateauSizeLatitude  = 5;

            _roverModel.Rover1.Position.Longitude = lon1;
            _roverModel.Rover1.Position.Latitude  = lat1;

            _roverModel.Rover2.Position.Longitude = lon2;
            _roverModel.Rover2.Position.Latitude  = lat2;

            _roverMovement = new RoverMovement(_roverModel);

            var valid = _roverMovement.CheckRoverPositionsAllowed();

            Assert.IsTrue(valid);
        }