public void An_ODataException_IsThrown_WithStatusNotImplemented() { ODataException odataException = Assert.Throws <ODataException>( () => SkipQueryOptionValidator.Validate(_queryOptions, _validationSettings)); Assert.Equal(HttpStatusCode.NotImplemented, odataException.StatusCode); Assert.Equal("The query option $skip is not implemented by this service", odataException.Message); Assert.Equal("$skip", odataException.Target); }
public void An_ODataException_IsThrown_WithStatusBadRequest() { ODataException odataException = Assert.Throws <ODataException>( () => SkipQueryOptionValidator.Validate(_queryOptions, _validationSettings)); Assert.Equal(HttpStatusCode.BadRequest, odataException.StatusCode); Assert.Equal("The value for OData query $skip must be a non-negative numeric value", odataException.Message); Assert.Equal("$skip", odataException.Target); }
/// <inheritdoc/> public void Validate(ODataQueryOptions queryOptions, ODataValidationSettings validationSettings) { if (queryOptions is null) { throw new ArgumentNullException(nameof(queryOptions)); } if (validationSettings is null) { throw new ArgumentNullException(nameof(validationSettings)); } CountQueryOptionValidator.Validate(queryOptions, validationSettings); ExpandQueryOptionValidator.Validate(queryOptions, validationSettings); FilterQueryOptionValidator.Validate(queryOptions, validationSettings); FormatQueryOptionValidator.Validate(queryOptions, validationSettings); OrderByQueryOptionValidator.Validate(queryOptions, validationSettings); SearchQueryOptionValidator.Validate(queryOptions, validationSettings); SelectQueryOptionValidator.Validate(queryOptions, validationSettings); SkipQueryOptionValidator.Validate(queryOptions, validationSettings); SkipTokenQueryOptionValidator.Validate(queryOptions, validationSettings); TopQueryOptionValidator.Validate(queryOptions, validationSettings); }
public void NoExceptionIsThrown() { SkipQueryOptionValidator.Validate(_queryOptions, ODataValidationSettings.All); }
public void AnExceptionShouldNotBeThrown() { SkipQueryOptionValidator.Validate(_queryOptions, _validationSettings); }