public void ValidateThrowInFindOperationsByBindingParameterTypeHierarchyExceptionDoesNotSurface()
        {
            var              model            = new FindOperationsByBindingParameterTypeHierarchyThrowingCatchableExceptionEdmModel();
            IEdmEntityType   entityType       = new EdmEntityType("n", "EntityType");
            ODataPathSegment foundPathSegment = null;

            SelectPathSegmentTokenBinder.TryBindAsOperation(new SystemToken("foo", null), model, entityType, out foundPathSegment).Should().BeFalse();
        }
Example #2
0
        public void BindAsOperationWithWildcardInPathTokenAndBindingParameterTypeThrows()
        {
            var              model            = new FindOperationsByBindingParameterTypeHierarchyThrowingCatchableExceptionEdmModel();
            IEdmEntityType   entityType       = new EdmEntityType("n", "EntityType");
            ODataPathSegment foundPathSegment = null;

            Assert.False(SelectPathSegmentTokenBinder.TryBindAsOperation(new SystemToken("f*oo", null), model, entityType, out foundPathSegment));
        }
Example #3
0
        public void ValidateNonCatchableExceptionsThrowInFindOperationsByBindingParameterTypeHierarchyExceptionAndSurfaces()
        {
            var              model            = new FindOperationsByBindingParameterTypeHierarchyThrowingNonCatchableExceptionEdmModel();
            IEdmEntityType   entityType       = new EdmEntityType("n", "EntityType");
            ODataPathSegment foundPathSegment = null;
            Action           test             = () => SelectPathSegmentTokenBinder.TryBindAsOperation(new SystemToken("foo", null), model, entityType, out foundPathSegment);

            Assert.Throws <OutOfMemoryException>(test);
        }
        public void ValidateNonCatchableExceptionsThrowInFindOperationsByBindingParameterTypeHierarchyExceptionAndSurfaces()
        {
            var              model            = new FindOperationsByBindingParameterTypeHierarchyThrowingStackOverflowEdmModel();
            IEdmEntityType   entityType       = new EdmEntityType("n", "EntityType");
            ODataPathSegment foundPathSegment = null;
            Action           test             = () => SelectPathSegmentTokenBinder.TryBindAsOperation(new SystemToken("foo", null), model, entityType, out foundPathSegment);

#if NETCOREAPP1_0
            test.ShouldThrow <Exception>();
#else
            test.ShouldThrow <StackOverflowException>();
#endif
        }