public void CastTo_RecursiveDescentAppliedToPropertyToArrayIndex_Throws()
        {
            JsonPathElement element = new JsonPathRecursiveDescentElement(ElementCreator.CreateAny(JsonPathElementType.Property));

            Action action = () => element.CastTo <JsonPathArrayIndexElement>();

            action.Should().Throw <InvalidCastException>();
        }
        public void CastTo_RecursiveDescentAppliedToPropertyToProperty_Casts()
        {
            var             property = ElementCreator.CreateAny(JsonPathElementType.Property);
            JsonPathElement element  = new JsonPathRecursiveDescentElement(property);

            var actual = element.CastTo <JsonPathPropertyElement>();

            actual.Should().Be(property);
        }