public void Validate_ODataRequestOptions_Throws_ODataException_If_ODataMaxVersion_BelowMaxSupported() { var odataRequestOptions = new ODataRequestOptions( new Uri("https://services.odata.org/OData"), ODataIsolationLevel.None, ODataMetadataLevel.Minimal, ODataVersion.OData40, // symantically this makes no sense but the scenario is needed for the test case. ODataVersion.Parse("3.0")); var odataServiceOptions = new ODataServiceOptions( ODataVersion.MinVersion, ODataVersion.MaxVersion, new[] { ODataIsolationLevel.None }, new[] { "application/json" }); ODataException odataException = Assert.Throws <ODataException>(() => odataServiceOptions.Validate(odataRequestOptions)); Assert.Equal(ExceptionMessage.ODataMaxVersionNotSupported(odataRequestOptions.ODataMaxVersion, odataServiceOptions.MinVersion, odataServiceOptions.MaxVersion), odataException.Message); Assert.Equal(HttpStatusCode.BadRequest, odataException.StatusCode); Assert.Equal(ODataRequestHeaderNames.ODataMaxVersion, odataException.Target); }