Example #1
0
        public ValidationResult TryParse(string coordinate, out Coordinate result)
        {
            result = null;
            var validationResult = _coordinateValidator.Validate(coordinate);

            if (validationResult != ValidationResult.Success)
            {
                return(validationResult);
            }

            result = Parse(coordinate);

            return(ValidationResult.Success);
        }
Example #2
0
        public void SetCoordinate(Coordinate coordinate)
        {
            _validator.Validate(coordinate);

            X = coordinate.X;
            Y = coordinate.Y;
        }
        public void Parse_SensibleCoordinate_ValidationResultWithSuccess(string coordinatesFromClient, char expectedColumn, string expectedRow)
        {
            var result = _sut.Validate(coordinatesFromClient);

            result.Should().Be(ValidationResult.Success);
        }