public void ValidateSkipTokenQueryValidator_ThrowsOnNullOption()
        {
            // Arrange & Act & Assert
            SkipTokenQueryValidator validator = new SkipTokenQueryValidator();

            ExceptionAssert.Throws <ArgumentNullException>(() => validator.Validate(null, new ODataValidationSettings()));
        }
        public void ValidateSkipTokenQueryValidator_ThrowsOnNullSettings()
        {
            // Arrange & Act
            SkipTokenQueryValidator validator = new SkipTokenQueryValidator();

            ODataQueryContext    context = new ODataQueryContext(EdmCoreModel.Instance, typeof(int), null);
            SkipTokenQueryOption query   = new SkipTokenQueryOption("abc", context);

            // Assert
            ExceptionAssert.Throws <ArgumentNullException>(() => validator.Validate(query, null));
        }
        public void ValidateSkipTokenQueryValidator_ThrowsNotAllowedQueryOption()
        {
            // Arrange
            ODataValidationSettings settings = new ODataValidationSettings();

            ODataQueryContext context = new ODataQueryContext(EdmCoreModel.Instance, typeof(int), null);

            context.DefaultQuerySettings.EnableSkipToken = false;
            SkipTokenQueryOption query = new SkipTokenQueryOption("abc", context);

            SkipTokenQueryValidator validator = new SkipTokenQueryValidator();

            // Act & Assert
            ExceptionAssert.Throws <ODataException>(() => validator.Validate(query, settings),
                                                    "Query option 'SkipToken' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.");
        }