Exemple #1
0
        public void CreatePlateauSuccessTest(int upperRightCornerX, int upperRightCornerY)
        {
            Coordinate upperRightCorner = new Coordinate(upperRightCornerX, upperRightCornerY);
            Plateau    plateau          = plateauOperations.CreatePlateau(upperRightCorner);

            Assert.IsNotNull(plateau);
            Assert.AreEqual(plateau.MinX, 0);
            Assert.AreEqual(plateau.MinY, 0);
            Assert.AreEqual(plateau.MaxX, upperRightCornerX);
            Assert.AreEqual(plateau.MaxY, upperRightCornerY);
            Assert.IsNotNull(plateau.Rovers);
            Assert.IsNotNull(plateau.PlateauCode);
            Assert.IsNull(plateau.SelectedRover);
        }
Exemple #2
0
        public ServiceResult <Plateau> CreatePlateau(int upperRightCornerX, int upperRightCornerY)
        {
            ServiceResult <Plateau> result = new ServiceResult <Plateau>();

            try {
                Coordinate upperRightCorner = new Coordinate(upperRightCornerX, upperRightCornerY);
                Plateau    plateau          = plateauOperations.CreatePlateau(upperRightCorner);
                result.Response = plateau;
            }
            catch (Exception ex) {
                result.ResultStatus = ServiceResultStatus.Failed;
                result.ErrorMessage = $"Plateau not created. x:{upperRightCornerX}, y:{upperRightCornerY}";
                logger.ErrorLog(ex, result.ErrorMessage);
            }
            return(result);
        }