ReasonCodeExample.XPathInformation.Workbench.SearchResultFactory.Parse C# (CSharp) Метод

Parse() публичный Метод

public Parse ( object xpathResult ) : IList
xpathResult object
Результат IList
        public IList<SearchResult> Parse(object xpathResult)
        {
            if(xpathResult == null)
            {
                return Enumerable.Empty<SearchResult>().ToList();
            }

            if(xpathResult is IEnumerable)
            {
                return ParseEnumerableResult(xpathResult as IEnumerable).ToList();
            }

            return new[]
                   {
                       ParseSimpleResult(xpathResult)
                   };
        }

Usage Example

        public void HandlesNullGracefully()
        {
            // Arrange
            var factory = new SearchResultFactory();

            // Act
            var results = factory.Parse(null);

            // Assert
            Assert.That(results, Is.Not.Null.And.Empty);
        }
All Usage Examples Of ReasonCodeExample.XPathInformation.Workbench.SearchResultFactory::Parse