コード例 #1
0
 public void CreatePlateauAreaWithNegativeValue()
 {
     Assert.Throws <MarsRoverException>(() =>
     {
         var plateauArea = PlateauArea.Create(-3, -3);
     });
 }
コード例 #2
0
        public async Task <RoverInvoker> CreatePlateauArea(string plateauAreaValue)
        {
            if (!canCreatePlateauArea(plateauAreaValue))
            {
                throw new MarsRoverException("Please check your plateau area command. It should be '5 5'", MarsRoverExceptionCode.CreatePlateauAreaError);
            }

            var values = plateauAreaValue.Split(new char[] { Constants.Characters.Space }, StringSplitOptions.RemoveEmptyEntries);
            int width  = values[0].ToInt32();
            int height = values[1].ToInt32();

            this._rover.PlateauArea = PlateauArea.Create(width, height);

            return(this);
        }
コード例 #3
0
        public void CreatePlateauArea()
        {
            var plateauArea = PlateauArea.Create(5, 5);

            Assert.IsNotNull(plateauArea);
        }