Exemple #1
0
        public void FailedResults(string input)
        {
            var selectorResult = _selector.Get(input);

            Assert.IsFalse(selectorResult.IsSuccess);
            Assert.IsNull(selectorResult.InputPart);
            Assert.IsNotEmpty(selectorResult.FailedMessage);
        }
        public ParseResult <string> Parse(string input)
        {
            var description = _selector.Get(input).InputPart;

            if (string.IsNullOrEmpty(description))
            {
                return(new ParseResult <string>(false, null));
            }

            return(new ParseResult <string>(true, description));
        }
        public ParseResult <int> Parse(string input)
        {
            var issueNumberString = _selector.Get(input).InputPart;

            if (string.IsNullOrEmpty(issueNumberString))
            {
                return(new ParseResult <int>(true, DefaultIssueNumber));
            }

            var parseResult = int.TryParse(issueNumberString, out var issueNumber);

            return(new ParseResult <int>(parseResult, issueNumber));
        }
        public ParseResult <string> Parse(string input)
        {
            var label = _selector.Get(input).InputPart;

            return(new ParseResult <string>(true, label));
        }