#  OData ABNF Test Cases Version 4.02, 4.01, and 4.0
#
#  05 February 2024
#
#  Latest version: https://github.com/oasis-tcs/odata-abnf/blob/main/abnf/odata-abnf-testcases.yaml
#
#  Technical Committee:
#  OASIS Open Data Protocol (OData) TC
#  https://www.oasis-open.org/committees/odata
#
#  Chairs:
#  - Ralf Handl (ralf.handl@sap.com), SAP SE
#  - Michael Pizzo (mikep@microsoft.com), Microsoft
#
#  Editors:
#  - Ralf Handl (ralf.handl@sap.com), SAP SE
#  - Michael Pizzo (mikep@microsoft.com), Microsoft
#  - Martin Zurmuehl (martin.zurmuehl@sap.com), SAP SE
#
#  Additional artifacts:
#  This test case document is one component of a Work Product which consists of:
#  - OData Version 4.02 Part 1: Protocol
#  - OData Version 4.02 Part 2: URL Conventions
#  - OData ABNF Construction Rules Version 4.02
#  - OData ABNF Test Cases Version 4.02 (this document)
#
#  Related work:
#  This specification replaces or supersedes:
#  - OData ABNF Test Cases Version 4.0
#  This work product is related to
#  - OData Common Schema Definition Language (CSDL) JSON Representation Version 4.02
#  - OData Common Schema Definition Language (CSDL) XML Representation Version 4.02
#  - OData JSON Format Version 4.02
#
#  Abstract:
#  The Open Data Protocol (OData) enables the creation of REST-based data
#  services, which allow resources, identified using Uniform Resource
#  Identifiers (URLs) and defined in a data model, to be published and
#  edited by Web clients using simple HTTP messages. This document defines
#  the URL syntax for requests and the serialization format for primitive
#  literals in request and response payloads.
#
#  Overview:
#  This document contains positive and negative test cases for the
#  OData ABNF Construction Rules Version 4.02.
#  Positive test cases consist of the rule to test, the input string to parse,
#  and a description of the test case, often starting with a section number
#  referring to OData Version 4.02 Part 2: URL Conventions.
#  Negative test cases in addition state the character position at which the
#  invalid portion of input text starts, 0 meaning the whole input string.
#
#  These test cases can be automatically executed with the ABNF test tool
#  available at https://github.com/oasis-tcs/odata-abnf/tree/main/lib.
#  This tool is neither required for interpreting the test cases, nor is it
#  part of the OData work product.

Constraints:
  customAggregate: []
  expressionAlias: []
  action:
    - ActionName
    - Cluster
    - Discount
    - Rejection
  actionImport:
    - Activation
  complexColProperty:
    - Addresses
    - _at_Core_dot_Messages
  complexColFunction:
    - MostPopularAddresses
  complexColFunctionImport:
    - TheMostPopularAddresses
  complexFunction:
    - MostPopularAddress
  complexFunctionImport:
    - TheMostPopularAddress
  complexProperty:
    - Address
  complexTypeName:
    - Address
    - AddressWithLocation
  customName:
    - "!deltatoken"
    - "!special"
    - find
  entityAnnotationInFragment:
    - "@Namespace.EntityTerm"
  entityAnnotationInQuery:
    - "@Namespace.EntityTerm"
  entityColFunction:
    - AllOrders
    - ProductsByColor
    - WithIngredients
  entityColFunctionImport:
    - AllProductsByColor
    - AllProductsByCategoryId
    - EmployeesByManager
    - ProductsByCategoryId
    - ProductsByColor
    - ProductsByComplex
    - ProductsByCustomer
    - ProductsOrderedBy
  entityColNavigationProperty:
    - DirectReports
    - Items
    - Orders
    - Products
    - Sales
  entityFunction:
    - BestProduct
    - MostExpensive
  entityFunctionImport:
    - TheBestProduct
  entityNavigationProperty:
    - Category
    - Continent
    - Country
    - Countries
    - CountrySet
    - Currency
    - Customer
    - Customers
    - Manager
    - Product
    - ProductGroup
    - Supplier
    - Time
  entitySetName:
    - Categories
    - Countries
    - Customers
    - Employees
    - LeaveRequests
    - Orders
    - OrderItems
    - People
    - Products
    - Sales
    - SalesOrganizations
    - Suppliers
  entityTypeName:
    - Customer
    - Employee
    - Manager
    - BestSellingProduct
    - PreferredSupplier
    - VipCustomer
  enumerationMember:
    - Solid
    - Yellow
  enumerationTypeName:
    - NameKind
    - Pattern
  keyPathLiteral:
    - "1"
    - "2001"
    - A1245
    - O'Neil
    - O%27Neil
    - Smartphone%2FTablet
  namespacePart:
    - Core
    - Measures
    - Model
    - Namespace
    - odata
    - SaM
    - Sales
    - Special
  parameterName:
    - categoryId
    - color
    - colors
    - customer
    - Customers
    - complex
    - Ingredients
    - Kind
    - Location
    - ManagerID
    - Number
    - Rank
    - Size
    - What
    - Where
    - Word
    - Word1
    - Word2
  primitiveAnnotationInQuery:
    - "@Measures.Currency"
  primitiveColFunction:
    - MostPopularNames
  primitiveColFunctionImport:
    - TheMostPopularNames
  primitiveColProperty:
    - EmailAddresses
    - Names
    - Sizes
  primitiveFunction:
    - Available
    - MostPopularCategory
    - MostPopularName
    - PhoneticallySimilar
    - GeoLocation
  primitiveKeyProperty:
    - Code
    - Date
    - ID
    - ItemID
    - OrderID
    - Size
  primitiveNonKeyProperty:
    - AccountRepresentative
    - Age
    - Amount
    - BirthDate
    - City
    - code
    - CompanyName
    - ContactName
    - Completed
    - Cost
    - CountryCode
    - eyeColor
    - FirstName
    - LastName
    - LifeTime
    - Line
    - Location
    - message
    - Month
    - Name
    - Population
    - Price
    - Quantity
    - Rating
    - ReleaseDate
    - Revenue
    - SalesArea
    - severity
    - Shipped
    - Spokesperson
    - State
    - Status
    - Street
    - style
    - SumAmount
    - TaxRate
    - Title
    - X
    - ZipCode
  singletonEntity:
    - BestProductEverCreated
    - MainSupplier
    - SingletonEntity
  streamProperty:
    - Thumbnail

TestCases:
  - Name: URI with IPv4 address, path and trailing slash
    Rule: odataUri
    Input: http://127.0.0.1:8080/MyService/

  - Name: URI with IPv6 address, path and trailing slash
    Rule: odataUri
    Input: https://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:8080/MyService/

  - Name: URI with IPvFuture address, path and trailing slash
    Rule: odataUri
    Input: https://[v7.0]/MyService/

  - Name: URI without schema separator
    Rule: odataUri
    FailAt: 4
    Input: http//My.Org/

  - Name: Binary with X
    Rule: binaryLiteral
    FailAt: 0
    Input: X'1a2B3c4D'

  - Name: Binary - empty
    Rule: binaryLiteral
    Input: binary''

  - Name: Binary - f
    Rule: binaryLiteral
    Input: binary'Zg=='

  - Name: Binary - f (pad character is optional)
    Rule: binaryLiteral
    Input: binary'Zg'

  - Name: Binary - fo
    Rule: binaryLiteral
    Input: binary'Zm8='

  - Name: Binary - fo (pad character is optional)
    Rule: binaryLiteral
    Input: binary'Zm8='

  - Name: Binary - foo
    Rule: binaryLiteral
    Input: binary'Zm9v'

  - Name: Binary - foob
    Rule: binaryLiteral
    Input: binary'Zm9vYg=='

  - Name: Binary - fooba
    Rule: binaryLiteral
    Input: binary'Zm9vYmE='

  - Name: Binary - foobar
    Rule: binaryLiteral
    Input: binary'Zm9vYmFy'

  - Name: Boolean - true
    Rule: boolean
    Input: "true"

  - Name: Boolean - false
    Rule: boolean
    Input: "false"

  - Name: Boolean - literals are case-insensitive
    Rule: boolean
    Input: tRUe

  - Name: Boolean - payload values are lowercase
    Rule: booleanValue
    Input: tRUe
    FailAt: 0

  - Name: Boolean - payload values are lowercase
    Rule: booleanValue
    Input: "true"

  - Name: Date in URL
    Rule: date
    Input: 2012-09-03

  - Name: Date in body or DefaultValue
    Rule: dateValue
    Input: 2012-09-10

  - Name: Date
    Rule: date
    Input: 2012-09-20

  - Name: Date
    Rule: date
    Input: 2012-09-03

  - Name: "Date: year zero"
    Rule: date
    Input: 0000-01-01

  - Name: "Date: negative"
    Rule: date
    Input: -10000-04-01

  - Name: "Date: negative Infinity"
    Rule: date
    FailAt: 1
    Input: -INF

  - Name: "Date: positive Infinity"
    Rule: date
    FailAt: 0
    Input: INF

  - Name: "DateTimeOffset: no seconds"
    Rule: dateTimeOffsetValue
    Input: 2012-09-03T13:52Z

  - Name: "DateTimeOffset: seconds"
    Rule: dateTimeOffsetValue
    Input: 2012-09-03T22:09:02Z

  - Name: "DateTimeOffset: leap second"
    Rule: dateTimeOffsetValue
    Input: 1972-06-30T23:59:60Z

  - Name: "DateTimeOffset: subseconds"
    Rule: dateTimeOffsetValue
    Input: 2012-08-31T18:19:22.1Z

  - Name: "DateTimeOffset: year zero"
    Rule: dateTimeOffsetValue
    Input: 0000-01-01T00:00Z

  - Name: "DateTimeOffset: negative"
    Rule: dateTimeOffsetValue
    Input: -10000-04-01T00:00Z

  - Name: "DateTimeOffset: Midnight this day"
    Rule: dateTimeOffsetValue
    FailAt: 12
    Input: 2011-12-31T24:00Z

  - Name: "DateTimeOffset: Midnight this day with seconds"
    Rule: dateTimeOffsetValue
    FailAt: 12
    Input: 2011-12-31T24:00:00Z

  - Name: "DateTimeOffset: CEST"
    Rule: dateTimeOffsetValue
    Input: 2012-09-03T14:53+02:00

  - Name: "DateTimeOffset: UTC"
    Rule: dateTimeOffsetValue
    Input: 2012-09-03T12:53Z

  - Name: "DateTimeOffset: 24:00"
    Rule: dateTimeOffsetValue
    FailAt: 12
    Input: 2012-09-03T24:00-03:00

  - Name: "DateTimeOffset: negative infinity"
    Rule: dateTimeOffsetValue
    FailAt: 1
    Input: -INF

  - Name: "DateTimeOffset: positive infinity"
    Rule: dateTimeOffsetValue
    FailAt: 0
    Input: INF

  - Name: "DateTimeOffset: no percent-encoding in payloads"
    Rule: dateTimeOffsetValue
    FailAt: 13
    Input: 2012-09-03T23%3A59Z

  - Name: "DateTimeOffset: no percent-encoding in payloads"
    Rule: dateTimeOffsetValue
    FailAt: 19
    Input: 2012-09-03T23:59+01%3A00

  - Name: "DateTimeOffset: with percent-encoding in URLs"
    Rule: dateTimeOffsetLiteral
    Input: 2012-09-03T23%3A59%2B01%3A00

  - Name: DateTimeOffset - legacy rule name for Temporal spec
    Rule: dateTimeOffsetValueInUrl
    Input: 2012-09-03T23%3A59%2B01%3A00

  - Name: Decimal
    Rule: decimalValue
    Input: "3.14"

  - Name: Decimal - exponential notation
    Rule: decimalValue
    Input: "-1.234567e3"

  - Name: Decimal - exponential notation
    Rule: decimalValue
    Input: "1e-101"

  - Name: Decimal - negative infinity
    Rule: decimalValue
    Input: -INF

  - Name: Decimal - positive infinity
    Rule: decimalValue
    Input: INF

  - Name: Decimal - not a number
    Rule: decimalValue
    Input: NaN

  - Name: Duration
    Rule: durationValue
    Input: -P6DT23H59M59.9999S

  - Name: Duration - no plus allowed
    Rule: durationValue
    FailAt: 0
    Input: +P6DT23H59M59.9999S

  - Name: Duration in body - no years allowed
    Rule: durationValue
    FailAt: 2
    Input: P1Y6DT23H59M59.9999S

  - Name: Duration in body - no months allowed
    Rule: durationValue
    FailAt: 2
    Input: P1M6DT23H59M59.9999S

  - Name: Duration in URL
    Rule: durationLiteral
    Input: duration'P6DT23H59M59.9999S'

  - Name: Duration in URL without prefix
    Rule: durationLiteral
    Input: "'P6DT23H59M59.9999S'"

  - Name: Decimal - negative integer
    Rule: decimalValue
    Input: "-2"

  - Name: Decimal - positive integer in URL
    Rule: primitiveLiteral
    Input: "%2B42"

  - Name: Decimal - positive integer
    Rule: decimalValue
    Input: "+42"

  - Name: Decimal - trailing dot
    Rule: decimalValue
    FailAt: 3
    Input: "42."

  - Name: "Decimal: no digit before decimal point"
    Rule: decimalValue
    FailAt: 0
    Input: ".1"

  - Name: Decimal in URL
    Rule: decimalLiteral
    Input: "3.14"

  - Name: Double
    Rule: doubleValue
    Input: "3.14"

  - Name: Double with exponent
    Rule: doubleValue
    Input: "-0.314e1"

  - Name: Double with at most one exponent
    Rule: doubleValue
    FailAt: 8
    Input: -0.314e1e2

  - Name: Negative infinity
    Rule: doubleValue
    Input: -INF

  - Name: Positive infinity
    Rule: doubleValue
    Input: INF

  - Name: Not a Number
    Rule: doubleValue
    Input: NaN

  - Name: Double in URL
    Rule: doubleLiteral
    Input: "-0.314e1"

  - Name: Single in URL
    Rule: singleLiteral
    Input: "%2B0.314e%2B1"

  - Name: Single
    Rule: singleValue
    Input: "+0.314e+1"

  - Name: Byte
    Rule: byteValue
    Input: "255"

  - Name: SByte in URL
    Rule: sbyteLiteral
    Input: "%2B128"

  - Name: SByte
    Rule: sbyteValue
    Input: "-128"

  - Name: Int16 in URL
    Rule: int16Literal
    Input: "%2B32000"

  - Name: Int16
    Rule: int16Value
    Input: "+32000"

  - Name: Int32 in URL
    Rule: int32Literal
    Input: "%2B2000000000"

  - Name: Int32
    Rule: int32Value
    Input: "-2000000000"

  - Name: Int64 in URL
    Rule: int64Literal
    Input: "%2B1234567890123456789"

  - Name: Int64
    Rule: int64Value
    Input: "1234567890123456789"

  - Name: "Null: unqualified"
    Rule: "null"
    Input: "null"

  - Name: String
    Rule: stringLiteral
    Input:
      "'ABCDEFGHIHJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\
      ('')*+,;=:@'"

  - Name: String
    Rule: stringLiteral
    Input: "'O''Neil'"

  - Name: String
    Rule: stringLiteral
    Input: "%27O'%27Neil'"

  - Name: String
    Rule: stringLiteral
    FailAt: 3
    Input: "'O'Neil'"

  - Name: String
    Rule: stringLiteral
    FailAt: 5
    Input: "'O%27Neil'"

  - Name: String
    Rule: stringLiteral
    Input: "'%26%28'"

  - Name: primitive value in request body - enumeration member
    Rule: primitiveValue
    Input: Yellow

  - Name: primitive value in request body - geo point
    Rule: primitiveValue
    Input: SRID=0;Point(142.1 64.1)

  - Name: primitive value in request body - integer
    Rule: primitiveValue
    Input: "0123456789"

  - Name: primitive value in request body - guid
    Rule: primitiveValue
    Input: 01234567-89ab-cdef-0123-456789abcdef

  - Name: primitive value in request body - binary
    Rule: primitiveValue
    Input: a123456789abcdefABA=

  - Name: primitive value in request body - binary with line breaks and spaces
    Rule: primitiveValue
    FailAt: 8
    Input: "a1234567 89\rab\r

      \              cdefABA"

  - Name: Resource Path - Entity Set
    Rule: resourcePath
    Input: Categories

  - Name: Resource Path - Entity
    Rule: resourcePath
    Input: Categories(11)

  - Name: Resource Path - Entity
    Rule: resourcePath
    Input: Categories(ID=1)

  - Name: Key
    Rule: stringLiteral
    Input: "'Hugo''s%20Tavern'"

  - Name: Resource Path - Entity
    Rule: resourcePath
    Input: Categories(ID=1,Size=5)

  - Name: Correct Guid
    Rule: guid
    Input: 01234567-89ab-cdef-0123-456789abcdef

  - Name: Guid with wrong character
    Rule: guid
    FailAt: 5
    Input: 01234g67-89ab-cdef-0123-456789abcdef

  - Name: Guid with less than 32 digits
    Rule: guid
    FailAt: 23
    Input: 01234567-89ab-cdef-456789abcdef

  - Name: TimeOfDay
    Rule: timeOfDayValue
    Input: 11:22:33

  - Name: TimeOfDay - percent-encoded colon
    Rule: timeOfDayLiteral
    Input: 11%3A22%3a33

  - Name: TimeOfDay - no percent-encoding in payloads
    Rule: timeOfDayValue
    FailAt: 2
    Input: 11%3A22%3a33

  - Name: "TimeOfDay: no seconds"
    Rule: timeOfDayValue
    Input: 11:22

  - Name: "TimeOfDay: fractional seconds"
    Rule: timeOfDayValue
    Input: 11:22:33.4444444

  - Name: "TimeOfDay: 24:00"
    Rule: timeOfDayValue
    FailAt: 1
    Input: 24:00:00

  - Name: Identifier
    Rule: odataIdentifier
    Input: TheQuickBrownFoxSays42

  - Name: Identifier with leading underscores
    Rule: odataIdentifier
    Input: __ID

  - Name: "Identifier: no starting digit"
    Rule: odataIdentifier
    FailAt: 0
    Input: 0time

  - Name: "Identifier: no dots within"
    Rule: odataIdentifier
    FailAt: 2
    Input: No.Dot

  - Name: Entity Set
    Rule: resourcePath
    Input: Products

  - Name: Inline Parameter Syntax
    Rule: odataUri
    Input: http://host/service/EmployeesByManager(ManagerID=3)

  - Name: Inline Parameter Syntax
    Rule: odataUri
    Input: http://host/service/EmployeesByManager(ManagerID=@p1)?@p1=3

  - Name: Inline Parameter Syntax
    Rule: odataUri
    Input: http://host/service/EmployeesByManager?ManagerID=3

  - Name: Inline Parameter Syntax
    Rule: odataUri
    Input: http://host/service/EmployeesByManager?@ManagerID=3

  - Name: 2 URL Components - service root URL
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/

  - Name: 2 URL Components - service root directly at server root
    Rule: odataUri
    Input: http://My.Org:80/

  - Name: 2 URL Components - resource path
    Rule: resourcePath
    Input: Categories(1)/Products

  - Name: 2 URL Components - resource path
    Rule: resourcePath
    Input: Categories(1)/Products

  - Name: 2 URL Components - key with key property alias
    Rule: resourcePath
    Input: Categories(KeyAlias=1)

  - Name: 2 URL Components - key with parameter alias - short form
    Rule: odataRelativeUri
    Input: Categories(@key)?@key=1

  - Name: 2 URL Components - key with parameter alias - long form
    Rule: odataRelativeUri
    Input: Categories(ID=@key)?@key=1

  - Name: 2 URL Components - query options
    Rule: queryOptions
    Input: $top=2&$orderby=Name

  - Name: 2 URL Components - resource path and query options
    Rule: odataRelativeUri
    Input: Categories(1)/Products?$top=2&$orderby=Name

  - Name: 2 URL Components - single quotes
    Rule: odataRelativeUri
    Input: Customers('O''Neil')

  - Name: 2 URL Components - single quotes
    Rule: odataRelativeUri
    Input: Customers(%27O%27%27Neil%27)

  - Name: 2 URL Components - unquoted single quotes
    Rule: odataRelativeUri
    FailAt: 15
    Input: Customers('O%27Neil')

  - Name: 2 URL Components - parentheses
    Rule: odataRelativeUri
    Input: Customers%28%27O%27%27Neil%27%29

  - Name: 2 URL Components - encoded forward slash
    Rule: odataUri
    Input: http://host/service/Categories('Smartphone%2FTablet')

  - Name: 2 URL Components - unencoded forward slash
    Rule: odataRelativeUri
    FailAt: 22
    Input: Categories('Smartphone/Tablet')

  - Name: 2 URL Components - empty query options
    Rule: odataRelativeUri
    Input: Customers?

  - Name: 4.1 - Metadata URL
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$metadata

  - Name: 4.1 - Metadata URL - CSDL JSON
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$metadata?$format=json

  - Name: 4.1 - Metadata URL - CSDL XML
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$metadata?$format=xml

  - Name: 4.1 - Metadata URL - allowed
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$metadata?$format=text/html

  - Name: 4.1 - Metadata URL - allowed
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$metadata?$format=text/html&!special

  - Name: 4.2 - Batch URL
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$batch

  - Name: 4.2 - Batch URL - JSON batch response
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$batch?$format=json

  - Name: 4.2 - Batch URL - multipart batch response
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$batch?$format=multipart/mixed

  - Name: 4.2 - Batch URL - allowed
    Rule: odataUri
    Input: http://services.odata.org/OData/OData.svc/$batch?!special

  - Name: 4.3 Addressing entities - entity set
    Rule: entitySetName
    Input: Products

  - Name: 4.3 Addressing entities - entity set
    Rule: odataRelativeUri
    Input: Products

  - Name: 4.3 Addressing entities - no trailing dot
    Rule: odataRelativeUri
    FailAt: 8
    Input: Products.('foo')

  - Name: 4.3 Addressing entities - no leading dot
    Rule: odataRelativeUri
    FailAt: 0
    Input: .Products('foo')

  - Name: 4.3 Addressing entities - function call
    Rule: odataRelativeUri
    Input: ProductsByCategoryId(categoryId=2)

  - Name: 4.3 Addressing entities - function call with subsequent key segment
    Rule: odataRelativeUri
    Input: ProductsByCategoryId(categoryId=2)(2)
    Expect:
      - entityColFunctionImport:ProductsByCategoryId
      - parameterName:categoryId
      - keyPredicate:(2)

  - Name: 4.3 Addressing entities - function call with alias
    Rule: odataRelativeUri
    Input: ProductsByCategoryId(categoryId=@cat)?@cat=2

  - Name: 4.3 Addressing entities - function call with alias for expression
    Rule: odataRelativeUri
    Input: ProductsByCategoryId(categoryId=@cat)?@cat=Model.MostPopularCategory(Rank=2)

  - Name: 4.3 Addressing entities - function call with query parameter
    Rule: odataRelativeUri
    Input: ProductsByCategoryId(categoryId=2)

  - Name: 4.3 Addressing entities - function call with query parameter
    Rule: odataRelativeUri
    Input: ProductsByCategoryId?@categoryId=2

  - Name: 4.3 Addressing entities - function parameter
    Rule: functionParameter
    Input: color='red'

  - Name: 4.3 Addressing entities - top-level function call
    Rule: odataRelativeUri
    Input: ProductsByColor(color='red')

  - Name: 4.3 Addressing entities - bound function call
    Rule: odataRelativeUri
    Input: Categories(1)/Model.ProductsByColor(color='red')

  - Name: 4.3 Addressing entities - bound function call with implicit parameter
      aliases
    Rule: odataRelativeUri
    Input: Categories(1)/Model.ProductsByColor?@color='red'

  - Name: 4.3 Addressing entities - single entity (short)
    Rule: resourcePath
    Input: Categories(1)

  - Name: 4.3 Addressing entities - single entity (short)
    Rule: odataRelativeUri
    Input: Customers(1)

  - Name: 4.3 Addressing entities - single entity (long)
    Rule: resourcePath
    Input: Categories(ID=1)

  - Name: 4.3 Addressing entities - single entity (string)
    Rule: resourcePath
    Input: Categories('Tablet')

  - Name: 4.3 Addressing entities - single entity (string)
    Rule: resourcePath
    Input: Categories('7''''%20Tablet')

  - Name: 4.3 Addressing entities - single entity (string)
    Rule: resourcePath
    Input: Categories%28%27Tablet%27%29

  - Name: 4.3 Addressing entities - single entity (string)
    Rule: resourcePath
    Input: Categories('Tablet%2FSlate')

  - Name: 4.3 Addressing entities - single entity (wrong)
    Rule: resourcePath
    FailAt: 18
    Input: Categories('Tablet/Slate')

  - Name: 4.3 Addressing entities - single entity (string)
    Rule: resourcePath
    Input: Categories('Tablet%20%28small%29')

  - Name: 4.3 Addressing entities - single entity (string)
    Rule: resourcePath
    Input: Categories('Tablet%20(small)')

  - Name: 4.3 Addressing entities - single entity (string)
    Rule: resourcePath
    Input: Categories('Tablet%20)small(')

  - Name: 4.3 Addressing entities - single entity (timestamp)
    Rule: resourcePath
    Input: Categories(2018-02-13T23:59:59Z)

  - Name: 4.3 Addressing entities - single entity (timestamp, percent-encoded colon)
    Rule: resourcePath
    Input: Categories(2018-02-13T23%3A59%3A59Z)

  - Name: 4.3 Addressing entities - single entity (time)
    Rule: resourcePath
    Input: Categories(23:59:59)

  - Name: 4.3 Addressing entities - single entity (time, percent-encoded colon)
    Rule: resourcePath
    Input: Categories(23%3A59%3A59)

  - Name: 4.3 Addressing entities - single entity (wrong)
    Rule: resourcePath
    FailAt: 19
    Input: Categories(ID=wrong)

  - Name: 4.3 Addressing entities - single entity (multi-part key)
    Rule: resourcePath
    Input: OrderItems(OrderID=1,ItemID='a')

  - Name: 4.3 Addressing entities - single entity (wrong multi-part key)
    Rule: resourcePath
    FailAt: 20
    Input: OrderItems(OrderID=1;ItemID='a')

  - Name: 4.3 Addressing entities - bound operation on entity set
    Rule: resourcePath
    Input: Products/Model.MostExpensive()

  - Name: 4.3 Addressing entities - follow navigation property
    Rule: resourcePath
    Input: Products(1)/Supplier

  - Name: 4.3 Addressing entities - follow navigation property and call function
    Rule: odataRelativeUri
    Input: Categories(1)/Products/Model.AllOrders()

  - Name:
      4.3 Addressing entities - follow navigation property and call function,
      then count results
    Rule: odataRelativeUri
    Input: Categories(1)/Products/Model.AllOrders()/$count

  - Name:
      4.3 Addressing entities - follow navigation property and call function -
      no parens
    Rule: odataRelativeUri
    Input: Categories(1)/Products/Model.AllOrders

  - Name:
      4.3 Addressing entities - follow navigation property and call function -
      no namespace
    Rule: odataRelativeUri
    Input: Categories(1)/Products/AllOrders

  - Name: 4.3 Addressing entities - follow navigation property and call function
    Rule: odataRelativeUri
    Input: Categories(1)/Products/Model.MostExpensive()

  - Name: 4.3 Addressing entities - singleton entities
    Rule: resourcePath
    Input: SingletonEntity

  - Name: 4.3 Addressing entities - single navigation property in complex type
    Rule: resourcePath
    Input: Customers(1)/Address/Country

  - Name: 4.3 Addressing entities - collection navigation property in complex type
    Rule: resourcePath
    Input: Customers(1)/Address/Products

  - Name: 4.3.1 Canonical URL
    Rule: odataRelativeUri
    Input: Categories(1)/Products(1)

  - Name: 4.3.4 $entity with OData URL
    Rule: odataRelativeUri
    Input: $entity?$id=http://host/path

  - Name: 4.3.4 $entity with URN
    Rule: odataRelativeUri
    Input: $entity?$id=urn:some:id

  - Name: 4.3.4 $entity with URN, id without $ prefix
    Rule: odataRelativeUri
    Input: $entity?id=urn:some:id

  - Name: 4.3.4 $entity with OData URL, $select and $expand fails without type-cast
    Rule: odataRelativeUri
    FailAt: 48
    Input: $entity?$id=http://myservice/Customers('ALFKI')&$select=CompanyName,ContactName&$expand=Orders

  - Name: 4.3.4 $entity with OData URL, $select and $expand
    Rule: odataRelativeUri
    Input: $entity/Model.Customer?$id=http://myservice/Customers('ALFKI')&$select=CompanyName,ContactName&$expand=Orders

  - Name: 4.3.4 $entity without $id fails
    Rule: odataRelativeUri
    FailAt: 20
    Input: $entity?$format=json

  - Name: 4.3.6  Key-as-Segment - single entity (numeric single-part key)
    Rule: odataRelativeUri
    Input: Customers/1

  - Name: 4.3.6  Key-as-Segment - single entity (string single-part key)
    Rule: resourcePath
    Input: Employees/A1245

  - Name: 4.3.6  Key-as-Segment - single entity (string single-part key)
    Rule: resourcePath
    Input: People/O'Neil

  - Name: 4.3.6  Key-as-Segment - single entity (string single-part key)
    Rule: resourcePath
    Input: People/O%27Neil

  - Name: 4.3.6  Key-as-Segment - single entity (string single-part key)
    Rule: resourcePath
    Input: Categories/Smartphone%2FTablet

  - Name: 4.3.6  Key-as-Segment - single entity (multi-part key)
    Rule: resourcePath
    Input: OrderItems/2001/1

  - Name: 4.3.6  Key-as-Segment - navigation (segment)
    Rule: resourcePath
    Input: Orders/1/Items

  - Name: 4.3.6  Key-as-Segment - navigation (segment)
    Rule: resourcePath
    Input: Orders/1/Items/1

  - Name: 4.4 Addressing Links between Entities
    Rule: odataRelativeUri
    Input: Categories(1)/Products/$ref

  - Name: 4.4 Addressing Links between Entities
    Rule: odataRelativeUri
    Input: Categories(1)/Products/$ref?$id=Products(0)

  - Name: 4.4 Addressing Links between Entities
    Rule: odataRelativeUri
    Input: Products(1)/Category/$ref

  - Name: 4.4 Addressing Links between Entities - count
    Rule: odataRelativeUri
    FailAt: 27
    Input: Categories(1)/Products/$ref/$count

  - Name: 4.4 Addressing Links between Entities
    Rule: odataRelativeUri
    Input: Categories(1)/Products(2)/$ref

  - Name: 4.4 Addressing Links between Entities
    Rule: odataRelativeUri
    FailAt: 30
    Input: Categories(1)/Products(2)/$ref/$count

  - Name: "4.4 edge case: entity set as references"
    Rule: odataRelativeUri
    Input: Categories/$ref

  - Name: "4.4 edge case: top-level entity as reference"
    Rule: odataRelativeUri
    Input: Categories(1)/$ref

  - Name: 4.5.1 Call unbound action via action import
    Rule: odataRelativeUri
    Input: Activation

  - Name: 4.5.1 Call bound action
    Rule: odataRelativeUri
    Input: LeaveRequests(4)/Model.Rejection

  - Name: 4.5.1 Call action at service root
    Rule: odataRelativeUri
    FailAt: 5
    Input: Model.Rejection

  - Name: 4.5.2 Call function import
    Rule: odataRelativeUri
    Input: TheBestProduct()

  - Name: 4.5.2 Call function import - no parentheses
    Rule: odataRelativeUri
    Input: TheBestProduct

  - Name: 4.5.2 Call function import - inline parameter
    Rule: odataRelativeUri
    Input: TheBestProduct(Size=3)

  - Name: 4.5.2 Call function import - only at service root
    Rule: odataRelativeUri
    FailAt: 27
    Input: Categories/TheBestProduct()

  - Name: 4.5.2 Call complex function import
    Rule: odataRelativeUri
    Input: TheMostPopularAddress()

  - Name: 4.5.2 Call complex collection function import
    Rule: odataRelativeUri
    Input: TheMostPopularAddresses()

  - Name: 4.5.2 Call primitive function import
    Rule: odataRelativeUri
    Input: TheMostPopularName()

  - Name: 4.5.2 Call primitive function import
    Rule: odataRelativeUri
    Input: TheMostPopularName()/$value

  - Name: 4.5.2 Call primitive collection function import
    Rule: odataRelativeUri
    Input: TheMostPopularNames()

  - Name: 4.5.2 Call bound complex function
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularAddress()

  - Name: 4.5.2 Call bound complex collection function
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularAddresses()

  - Name: 4.5.2 Call bound complex collection function
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularAddresses()/$count

  - Name: 4.5.2 Call bound complex collection function with cast
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularAddresses()/Model.AddressWithLocation

  - Name: 4.5.2 Call bound complex collection function with cast
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularAddresses()/Model.AddressWithLocation/$count

  - Name: 4.5.2 Call bound complex collection function with cast, no namespace
    Rule: odataRelativeUri
    Input: Customers/MostPopularAddresses()/AddressWithLocation/$count

  - Name: 4.5.2 Call bound complex collection function - multiple
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularAddresses()/Model.MostPopularNames()

  - Name: 4.5.2 Call bound complex collection function - multiple, no namespace
    Rule: odataRelativeUri
    Input: Customers/MostPopularAddresses()/MostPopularNames()

  - Name: 4.5.2 Call bound primitive function
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularName()

  - Name: 4.5.2 Call bound primitive function
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularName()/$value

  - Name: 4.5.2 Call bound primitive collection function
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularNames()

  - Name: 4.5.2 Call bound primitive collection function
    Rule: odataRelativeUri
    Input: Customers/Model.MostPopularNames()/$count

  - Name: 4.6 Addressing a Property - primitive
    Rule: odataRelativeUri
    Input: Categories(1)/ID

  - Name: 4.6 Addressing a Property - complex
    Rule: odataRelativeUri
    Input: Categories(1)/Address

  - Name: 4.6 Addressing a Property - complex path
    Rule: odataRelativeUri
    Input: Categories(1)/Address/Street

  - Name: 4.6 Addressing a Property - complex path with type cast
    Rule: odataRelativeUri
    Input: Categories(1)/Address/Model.AddressWithLocation/Location

  - Name: 4.6 Addressing a Property - stream
    Rule: odataRelativeUri
    Input: Categories(1)/Thumbnail

  - Name: 4.6 Addressing a Property - collection of primitive
    Rule: odataRelativeUri
    Input: Suppliers(1)/EmailAddresses

  - Name: 4.6 Addressing a Property - collection of complex
    Rule: odataRelativeUri
    Input: Suppliers(1)/Addresses

  - Name: 4.7 Addressing a Property Value
    Rule: odataRelativeUri
    Input: Categories(1)/ID/$value

  - Name: 4.7 Addressing a Property Value - with $format
    Rule: odataRelativeUri
    Input: Categories(1)/ID/$value?$format=json

  - Name: 4.7 Addressing a Property Value - illegal suffix
    Rule: odataRelativeUri
    FailAt: 23
    Input: Categories(1)/ID/$value/foo

  - Name: 4.7 Addressing a Property Value - complex
    Rule: odataRelativeUri
    FailAt: 22
    Input: Categories(1)/Address/$value

  - Name: 4.7 Addressing a Property Value - property of complex
    Rule: odataRelativeUri
    Input: Categories(1)/Address/Street/$value

  - Name: 4.7 Named Stream Property - $value does not make sense here
    Rule: odataRelativeUri
    FailAt: 24
    Input: Categories(1)/Thumbnail/$value

  - Name: 4.8 Addressing entities - entity set with $count
    Rule: odataRelativeUri
    Input: Products/$count

  - Name: 4.8 Addressing entities - entity set with $count
    Rule: odataRelativeUri
    Input: Products/$count?$filter=Price gt 5.00

  - Name: 4.8 Addressing entities - $count not last segment
    Rule: odataRelativeUri
    FailAt: 15
    Input: Products/$count/foo

  - Name: 4.8 Addressing entities - entity set navigation with $count
    Rule: odataRelativeUri
    Input: Products(1)/Items/$count

  - Name: 4.8 Addressing entities - collection property with $count
    Rule: odataRelativeUri
    Input: Products(1)/Addresses/$count

  - Name: 4.8 Addressing entities - collection property with $count
    Rule: odataRelativeUri
    Input: Products(1)/Sizes/$count

  - Name: 4.8 Addressing the Count - in $filter with navigation
    Rule: filter
    Input: $filter=Products/$count gt 0

  - Name: 4.8 Addressing the Count - in $filter with complex collection
    Rule: filter
    Input: $filter=Addresses/$count gt 0

  - Name: 4.8 Addressing the Count - in $filter with primitive collection
    Rule: filter
    Input: $filter=Sizes/$count gt 0

  - Name: 4.8 Addressing the Count - in $filter with filtered collection
    Rule: filter
    Input: $filter=Products/$count($filter=Price gt 5.00) gt 2

  - Name:
      4.8 Addressing the Count - collection navigation property with $count in
      $orderby
    Rule: orderby
    Input: $orderby=Products/$count

  - Name: 4.8 Addressing the Count - collection property with $count in $orderby
    Rule: orderby
    Input: $orderby=Addresses/$count

  - Name: 4.8 Addressing the Count - collection property with $count in $orderby
    Rule: orderby
    Input: $orderby=Sizes/$count

  - Name: 4.10 Addressing a Member of an Ordered Primitive Collection
    Rule: odataRelativeUri
    Input: Suppliers(1)/EmailAddresses/1

  - Name: 4.10 Addressing a Member of an Ordered Complex Collection
    Rule: odataRelativeUri
    Input: MainSupplier/Addresses/0

  - Name: 4.10 Addressing a Member of an Ordered Complex Collection with type-cast
    Rule: odataRelativeUri
    Input: Suppliers(1)/Addresses/Model.AddressWithLocation/-1

  - Name: 4.11 Inheritance - set of subtypes
    Rule: odataRelativeUri
    Input: Products/Model.BestSellingProduct

  - Name: 4.11 Inheritance - set of subtypes, then key access
    Rule: odataRelativeUri
    Input: Products/Model.BestSellingProduct(1)

  - Name: 4.11 Inheritance - key access, then cast to subtype
    Rule: odataRelativeUri
    Input: Products(1)/Model.BestSellingProduct

  - Name: 4.11 Inheritance - key access, then cast to subtype - only once
    Rule: odataRelativeUri
    FailAt: 61
    Input: Products(1)/Model.BestSellingProduct/Model.BestSellingProduct

  - Name: 4.11 Inheritance - complex type
    Rule: odataRelativeUri
    Input: Products(1)/Address/Model.AddressWithLocation

  - Name: 4.11 Inheritance - complex type with property
    Rule: odataRelativeUri
    Input: Products(1)/Address/Model.AddressWithLocation/Street

  - Name: 4.11 Inheritance - complex type with property, no namespace
    Rule: odataRelativeUri
    Input: Products(1)/Address/AddressWithLocation/Street

  - Name: 4.11 Inheritance - collection of complex type
    Rule: odataRelativeUri
    Input: Products(1)/Addresses/Model.AddressWithLocation

  - Name: "4.11 Inheritance - expressions: complex type"
    Rule: propertyPathExpr
    Input: Address/Model.AddressWithLocation

  - Name: "4.11 Inheritance - expressions: complex type with path"
    Rule: propertyPathExpr
    Input: Address/Model.AddressWithLocation/Street

  - Name: "4.11 Inheritance - expressions: complex type with path, no namespace"
    Rule: propertyPathExpr
    Input: Address/AddressWithLocation/Street

  - Name: "4.11 Inheritance - expressions: collection of complex type"
    Rule: propertyPathExpr
    Input: Addresses/Model.AddressWithLocation

  - Name: 4.11 Inheritance - $expand
    Rule: odataRelativeUri
    Input: Categories?$expand=Products/Model.BestSellingProduct

  - Name: 4.11 Inheritance - $expand, no namespace
    Rule: odataRelativeUri
    Input: Categories?$expand=Products/BestSellingProduct

  - Name: 4.11 Inheritance - $expand
    Rule: odataRelativeUri
    Input: Products?$expand=Model.BestSellingProduct/Sales

  - Name: 4.11 Inheritance - $expand, no namespace
    Rule: odataRelativeUri
    Input: Products?$expand=BestSellingProduct/Sales

  - Name: 4.11 Inheritance - $expand
    Rule: odataRelativeUri
    Input: Categories?$expand=Products/Model.BestSellingProduct($select=Name)

  - Name: 4.11 Inheritance - $expand on complex resource
    Rule: odataRelativeUri
    Input: TheMostPopularAddresses()?$expand=Model.AddressWithLocation/Country

  - Name: 4.12 Filter Path Segment
    Rule: odataRelativeUri
    Input: Products/$filter(@foo)?@foo=Age gt 3

  - Name: 4.12 Filter Path Segment - expression
    Rule: odataRelativeUri
    Input: Products/$filter(Age gt 3)

  - Name: 4.12 Filter Path Segment - multiple
    Rule: odataRelativeUri
    Input: Products/$filter(@foo)/$filter(@bar)?@foo=Age gt 3&@bar=Price lt 5

  - Name: 4.12 Filter Path Segment - multiple
    Rule: odataRelativeUri
    Input: Products/$filter(Age gt 3)/$filter(Price lt 5)

  - Name: 4.12 Filter Path Segment - with /$ref
    Rule: odataRelativeUri
    Input: Products/$filter(@foo)/$filter(@bar)/$ref?@foo=Age gt 3&@bar=Price lt 5

  - Name: 4.12 Filter Path Segment - with /$count
    Rule: odataRelativeUri
    Input: Products/$filter(@foo)/$filter(@bar)/$count?@foo=Age gt 3&@bar=Price lt 5

  - Name: 4.12 Filter Path Segment - with /$count and $filter query option
    Rule: odataRelativeUri
    Input:
      Products/$filter(@foo)/$filter(@bar)/$count?@foo=Age gt 3&@bar=Price lt
      5&$filter=Price lt 6

  - Name: 4.12 Filter Path Segment - multiple
    Rule: odataRelativeUri
    Input:
      Products/$filter(@foo)/Special.ProductsByColor(color='red')/$filter(@bar)?@foo=Age
      gt 3&@bar=Price lt 5

  - Name: 4.12 Filter Path Segment - multiple, no namespace
    Rule: odataRelativeUri
    Input:
      Products/$filter(@foo)/ProductsByColor(color='red')/$filter(@bar)?@foo=Age
      gt 3&@bar=Price lt 5

  - Name: 4.12 Filter Path Segment - with action
    Rule: odataRelativeUri
    Input: Products/$filter(@foo)/Special.Cluster?@foo=Age gt 3

  - Name: 4.12 Filter Path Segment followed by key predicate
    Rule: propertyPathExpr
    Input: Products/$filter(Age gt 3)(ID='Sugar')

  - Name: 4.12 Filter expression in query
    Rule: odataRelativeUri
    Input: Categories?$filter=Products/$filter(Age gt 3)/$count lt 10

  - Name: 4.12 Filter expression in query
    Rule: filter
    Input: $filter=Addresses/$filter(endswith(Street,'St'))/$count lt 10

  - Name: 4.12 $each Path Segment
    Rule: odataRelativeUri
    Input: Products/$filter(@foo)/$each

  - Name: 4.12 $each Path Segment - with action
    Rule: odataRelativeUri
    Input: Products/$filter(@foo)/$each/Special.Discount?@foo=Age gt 3

  - Name: 4.14 Addressing a Media Resource
    Rule: odataRelativeUri
    Input: Categories(1)/$value

  - Name: 4.15 - Cross Join
    Rule: odataRelativeUri
    Input:
      $crossjoin(Customers,Countries)?$expand=Customers($select=Name),Countries($select=Name)&$filter=Customers/CountryCode
      eq Countries/CountryCode and Countries/Name eq 'USA'

  - Name: 4.16 Addressing All Entities in a Service
    Rule: odataRelativeUri
    Input: $all?$search=red

  - Name: 4.16 Addressing All Entities in a Service - with type cast
    Rule: odataRelativeUri
    Input: $all/Model.Customer?$filter=contains(Name,'red')

  - Name: 4.17 Passing Query Options in the Request Body - entity set
    Rule: odataRelativeUri
    Input: People/$query

  - Name: 4.17 Passing Query Options in the Request Body - entity
    Rule: odataRelativeUri
    Input: People(42)/$query

  - Name: 4.17 Passing Query Options in the Request Body - collection of complex
    Rule: odataRelativeUri
    Input: People(42)/Addresses/$query

  - Name: 4.17 Passing Query Options in the Request Body - complex
    Rule: odataRelativeUri
    Input: People(42)/Address/$query

  - Name: 4.17 Passing Query Options in the Request Body - collection of primitive
    Rule: odataRelativeUri
    Input: People(42)/EmailAddresses/$query

  - Name: 4.17 Passing Query Options in the Request Body - primitive
    Rule: odataRelativeUri
    Input: People(42)/FirstName/$query

  - Name: 4.17 Passing Query Options in the Request Body - bound function call
    Rule: odataRelativeUri
    Input: Categories(1)/Model.ProductsByColor(color=@c)/$query

  - Name:
      4.17 Passing Query Options in the Request Body - bound function call with
      implicit parameter aliases
    Rule: odataRelativeUri
    Input: Categories(1)/Model.ProductsByColor/$query

  - Name: 4.17 Passing Query Options in the Request Body - function import with
      parameter
    Rule: odataRelativeUri
    Input: ProductsByComplex(complex=@c)/$query

  - Name: 4.17 Passing Query Options in the Request Body - function import -
      implicit parameter aliases
    Rule: odataRelativeUri
    Input: TheBestProduct/$query

  - Name: 4.17 Passing Query Options in the Request Body - Cross Join
    Rule: odataRelativeUri
    Input: $crossjoin(Customers,Countries)/$query

  - Name: 5.1.1 Filter
    Rule: filter
    Input: $filter=true

  - Name: 5.1.1 $ is optional
    Rule: filter
    Input: filter=true

  - Name: "5.1.1 Filter: no spaces"
    Rule: filter
    FailAt: 7
    Input: $filter =true

  - Name: "5.1.1 Filter: no spaces"
    Rule: filter
    FailAt: 9
    Input: $filter= true

  - Name: 5.1.1 Filter
    Rule: filter
    Input: $filter=Completed

  - Name: 5.1.1 Filter - member expressions
    Rule: firstMemberExpr
    Input: Product

  - Name: 5.1.1 Filter - member expressions - single navigation
    Rule: firstMemberExpr
    Input: Product/Supplier

  - Name: 5.1.1 Filter - member expressions - single-complex
    Rule: firstMemberExpr
    Input: Product/Supplier/Address

  - Name: 5.1.1 Filter - member expressions - single-complex-primitive
    Rule: firstMemberExpr
    Input: Product/Supplier/Address/Street

  - Name: 5.1.1 Filter - member expressions - single-complex-single
    Rule: firstMemberExpr
    Input: Product/Supplier/Address/Country

  - Name: 5.1.1 Filter - member expressions - single-complex-collection
    Rule: firstMemberExpr
    Input: Product/Supplier/Address/Products

  - Name: 5.1.1 Filter - member expressions - stream
    Rule: firstMemberExpr
    Input: Product/Thumbnail

  - Name: 5.1.1 Filter - member expressions - stream
    Rule: firstMemberExpr
    Input: Address/Thumbnail

  - Name: 5.1.1 Filter - member expressions - stream
    Rule: firstMemberExpr
    Input: Thumbnail/Model.Available()

  - Name: 5.1.1 Filter - member expressions - single-colComplex
    Rule: firstMemberExpr
    Input: Product/Supplier/Addresses

  - Name: 5.1.1 Filter - member expressions - single-primitive
    Rule: firstMemberExpr
    Input: Product/Supplier/CompanyName

  - Name: 5.1.1 Filter - member expressions - single-colPrimitive
    Rule: firstMemberExpr
    Input: Product/Supplier/EmailAddresses

  - Name: 5.1.1 Filter - member expressions - collection navigation
    Rule: firstMemberExpr
    Input: Supplier/Products

  - Name: 5.1.1 Filter - member expressions - collection navigation
    Rule: firstMemberExpr
    Input: Products

  - Name: 5.1.1 Filter - member expressions - collection navigation - count
    Rule: firstMemberExpr
    Input: Products/$count

  - Name: 5.1.1.1.1 Equals
    Rule: boolCommonExpr
    Input: true eq false

  - Name: 5.1.1.1.1 boolean - only true and false
    Rule: boolean
    FailAt: 0
    Input: "0"

  - Name: 5.1.1.1.1 boolean - only true and false
    Rule: boolean
    FailAt: 0
    Input: "1"

  - Name: 5.1.1.1.1 Equals - Property
    Rule: firstMemberExpr
    Input: Size

  - Name: 5.1.1.1.1 Equals
    Rule: boolCommonExpr
    Input: Size eq true

  - Name: 5.1.1.1.1 Equals - Literal
    Rule: primitiveLiteral
    Input: "4.0"

  - Name: 5.1.1.1.1 Equals - Literal
    Rule: primitiveLiteral
    Input: "'Huge'"

  - Name: 5.1.1.1.1 Equals
    Rule: boolCommonExpr
    Input: Size eq 4.0

  - Name: 5.1.1.1.1 Equals
    Rule: boolCommonExpr
    Input: Street eq 'Hugo'

  - Name: 5.1.1.1.1 Equals - property path argument
    Rule: firstMemberExpr
    Input: Address/Street

  - Name: 5.1.1.1.1 Equals - property path argument
    Rule: firstMemberExpr
    Input: Address/Model.AddressWithLocation/Location

  - Name: 5.1.1.1.1 Equals
    Rule: boolCommonExpr
    Input: Address/Street eq 'Hugo'

  - Name: 5.1.1.1.1 comparing complex types
    Rule: filter
    Input: $filter=Address eq {"Street":"NE
      40th","City":"Redmond","State":"WA","ZipCode":"98052"}

  - Name: 5.1.1.1.2 Not Equals
    Rule: boolCommonExpr
    Input: Name ne 'Milk'

  - Name: 5.1.1.1.2 Not Equals
    Rule: boolCommonExpr
    Input: true ne false

  - Name: 5.1.1.1.3 Greater Than
    Rule: boolCommonExpr
    Input: Name gt 'Milk'

  - Name: 5.1.1.1.4 Greater Than or Equal
    Rule: boolCommonExpr
    Input: Name ge 'Milk'

  - Name: 5.1.1.1.5 Less Than
    Rule: boolCommonExpr
    Input: Name lt 'Milk'

  - Name: 5.1.1.1.6 Less Than or Equal
    Rule: boolCommonExpr
    Input: Name le 'Milk'

  - Name: 5.1.1.1.7 Logical And
    Rule: boolCommonExpr
    Input: true and false

  - Name: 5.1.1.1.8 Logical Or
    Rule: boolCommonExpr
    Input: true or false

  - Name: 5.1.1.1.9 Logical Negation
    Rule: notExpr
    Input: not false

  - Name: 5.1.1.1.12 Logical Operator Examples
    Rule: boolCommonExpr
    Input: Name eq 'Milk'

  - Name: 5.1.1.1.12 Logical Operator Examples
    Rule: boolCommonExpr
    Input: Supplier/Name eq 'Milk'

  - Name: 5.1.1.1.12 Logical Operator Examples
    Rule: boolCommonExpr
    Input: Name EQ 'Milk' AND Price LT 2.55

  - Name: 5.1.1.1.12 Logical Operator Examples
    Rule: boolCommonExpr
    Input: Name Eq 'Milk' OR Price Lt 2.55

  - Name: 5.1.1.1.12 Logical Operator Examples
    Rule: boolCommonExpr
    Input: not endswith(Name,'ilk')

  - Name: 5.1.1.1.12 Logical Operator Examples
    Rule: boolCommonExpr
    Input: style has Sales.Pattern'Yellow'

  - Name: 5.1.1.1.12 Logical Operator Examples
    Rule: boolCommonExpr
    Input: Name in ('Milk', 'Cheese')

  - Name: 5.1.1.1.12 Logical Operator Examples
    Rule: boolCommonExpr
    Input: Name in ["Milk", "Cheese"]

  - Name: 5.1.1.2.1 Addition
    Rule: commonExpr
    Input: Price add 2.45

  - Name: 5.1.1.2.1 Addition
    Rule: commonExpr
    Input: (Price add 2.45) mod 2

  - Name: 5.1.1.2.2 Subtraction
    Rule: commonExpr
    Input: Price sub 0.55

  - Name: 5.1.1.2.3 Negate
    Rule: commonExpr
    Input: -Price

  - Name: 5.1.1.2.4 Multiplication
    Rule: commonExpr
    Input: Price mul 2

  - Name: 5.1.1.2.5 Division
    Rule: commonExpr
    Input: Price div 2

  - Name: 5.1.1.2.5 Division
    Rule: commonExpr
    Input: Price divby 2

  - Name: 5.1.1.2.6 Modulo
    Rule: commonExpr
    Input: Price mod 5

  - Name: 5.1.1.2.7 Arithmetic Operator Examples
    Rule: boolCommonExpr
    Input: Price add 2.45 eq 5.00

  - Name: 5.1.1.2.7 Arithmetic Operator Examples
    Rule: boolCommonExpr
    Input: Price sub 0.55 eq 2.00

  - Name: 5.1.1.2.7 Arithmetic Operator Examples
    Rule: boolCommonExpr
    Input: Price mul 2.0 eq 5.10

  - Name: 5.1.1.2.7 Arithmetic Operator Examples
    Rule: boolCommonExpr
    Input: Price div 2.55 eq 1

  - Name: 5.1.1.2.7 Arithmetic Operator Examples
    Rule: boolCommonExpr
    Input: Rating divby 2 eq 2.5

  - Name: 5.1.1.2.7 Arithmetic Operator Examples
    Rule: boolCommonExpr
    Input: Rating mod 5 eq 0

  - Name: 5.1.1.3 Parenthesis
    Rule: commonExpr
    Input: (true)

  - Name: 5.1.1.3 Parenthesis
    Rule: boolCommonExpr
    Input: ( true )

  - Name: 5.1.1.3 Parenthesis
    Rule: boolCommonExpr
    Input: (Name eq 'Milk')

  - Name: 5.1.1.3 Parenthesis
    Rule: boolCommonExpr
    Input: (false)

  - Name: 5.1.1.3 Parenthesis
    Rule: commonExpr
    Input: (4 add 5) mod (4 sub 1)

  - Name: 5.1.1.3 Parenthesis
    Rule: boolcommonExpr
    Input: (4 add 5) mod (4 sub 1) eq 0

  - Name: 5.1.1.5.1 concat
    Rule: commonExpr
    Input: concat(CompanyName, Name)

  - Name: 5.1.1.5.1 concat
    Rule: commonExpr
    Input: concat(concat(Street,'-'),City)

  - Name: 5.1.1.5.2 contains
    Rule: boolCommonExpr
    Input: contains(CompanyName,'lfreds')

  - Name: 5.1.1.5.2 contains
    Rule: boolCommonExpr
    Input: contains(Names,["Fred","George"])

  - Name: 5.1.1.5.3 endswith
    Rule: boolCommonExpr
    Input: endswith(CompanyName,'Futterkiste')

  - Name: 5.1.1.5.3 endswith
    Rule: boolCommonExpr
    Input: endswith(["Fred","George","Ron"],["George","Ron"])

  - Name: 5.1.1.5.3 indexof
    Rule: commonExpr
    Input: indexof(CompanyName,'lfreds')

  - Name: 5.1.1.5.4 indexof
    Rule: commonExpr
    Input: indexof(["Fred","George","Ron"],["George","Ron"]) eq 1

  - Name: 5.1.1.5.5 length
    Rule: boolCommonExpr
    Input: length(CompanyName) eq 19

  - Name: 5.1.1.5.5 length
    Rule: boolCommonExpr
    Input: length(["Fred","George","Ron"]) eq 3

  - Name: 5.1.1.5.6 startswith
    Rule: boolCommonExpr
    Input: startswith(CompanyName,'Futterkiste')

  - Name: 5.1.1.5.6 startswith
    Rule: boolCommonExpr
    Input: startswith(Supplier/Name,'Futterkiste')

  - Name: 5.1.1.5.6 startswith
    Rule: boolCommonExpr
    Input: startswith(["Fred","George","Ron"],["Fred","George"])

  - Name: 5.1.1.5.7 substring
    Rule: commonExpr
    Input: substring(CompanyName, 5)

  - Name: 5.1.1.5.7 substring with length
    Rule: commonExpr
    Input: substring(CompanyName,5,2)

  - Name: 5.1.1.6.1 hassubset
    Rule: boolCommonExpr
    Input: hassubset(Names,["Milk", "Cheese"])

  - Name: 5.1.1.6.1 hassubset
    Rule: boolCommonExpr
    Input: hassubset(["Milk", "Cheese"],Names)

  - Name: 5.1.1.6.2 hassubsequence
    Rule: boolCommonExpr
    Input: hassubsequence([4,1,3],[4,3])

  - Name: 5.1.1.7.1 matchesPattern ^A.*e$
    Rule: commonExpr
    Input: matchesPattern(CompanyName,'%5EA.*e$')

  - Name: 5.1.1.7.1 matchesPattern ^A.*e$ case-insensitive
    Rule: commonExpr
    Input: matchesPattern(CompanyName,'%5EA.*e$','i')

  - Name: 5.1.1.7.2 tolower
    Rule: commonExpr
    Input: tolower(CompanyName)

  - Name: 5.1.1.7.3 toupper
    Rule: commonExpr
    Input: toupper(CompanyName)

  - Name: 5.1.1.7.4 trim
    Rule: commonExpr
    Input: trim(CompanyName)

  - Name: 5.1.1.8.1
    Rule: commonExpr
    Input: date(LifeTime)

  - Name: 5.1.1.8.2
    Rule: commonExpr
    Input: day(BirthDate)

  - Name: 5.1.1.8.3
    Rule: commonExpr
    Input: fractionalseconds(LifeTime)

  - Name: 5.1.1.8.4
    Rule: commonExpr
    Input: hour(BirthDate)

  - Name: 5.1.1.8.5
    Rule: commonExpr
    Input: maxdatetime()

  - Name: 5.1.1.8.5 - non-canonical percent-encoding
    Rule: commonExpr
    Input: maxdatetime%28%20%29

  - Name: 5.1.1.8.6
    Rule: commonExpr
    Input: mindatetime()

  - Name: 5.1.1.8.6 - non-canonical percent-encoding
    Rule: commonExpr
    Input: mindatetime%28%20%29

  - Name: 5.1.1.8.7
    Rule: commonExpr
    Input: minute(BirthDate)

  - Name: 5.1.1.8.8
    Rule: commonExpr
    Input: month(BirthDate)

  - Name: 5.1.1.8.9
    Rule: commonExpr
    Input: now()

  - Name: 5.1.1.8.9 - non-canonical percent-encoding
    Rule: commonExpr
    Input: now%28%20%29

  - Name: 5.1.1.8.10
    Rule: commonExpr
    Input: second(BirthDate)

  - Name: 5.1.1.8.11
    Rule: commonExpr
    Input: time(ReleaseDate)

  - Name: 5.1.1.8.12 - totaloffsetminutes
    Rule: commonExpr
    Input: totaloffsetminutes(ReleaseDate)

  - Name: 5.1.1.8.13
    Rule: commonExpr
    Input: totalseconds(LifeTime)

  - Name: 5.1.1.8.14 year
    Rule: commonExpr
    Input: year(BirthDate)

  - Name: 5.1.1.9.1
    Rule: commonExpr
    Input: ceiling(Price)

  - Name: 5.1.1.9.2
    Rule: commonExpr
    Input: floor(Price)

  - Name: 5.1.1.9.3
    Rule: commonExpr
    Input: round(Price)

  - Name: 5.1.1.10.1 cast(1)
    Rule: commonExpr
    Input: cast(Model.Customer)

  - Name: 5.1.1.10.1 cast(1), no nanmespace
    Rule: commonExpr
    Input: cast(Customer)

  - Name: 5.1.1.10.1 cast(2)
    Rule: commonExpr
    Input: cast(Category,Model.Customer)

  - Name: 5.1.1.10.1 cast(2), no namespace
    Rule: commonExpr
    Input: cast(Category,Customer)

  - Name: 5.1.1.10.1 cast(3)
    Rule: commonExpr
    Input: cast(Category,Edm.Boolean)

  - Name: 5.1.1.10.2 isof(1)
    Rule: isofExpr
    Input: isof(Model.Customer)

  - Name: 5.1.1.10.2 isof(1), no namespace
    Rule: isofExpr
    Input: isof(Customer)

  - Name: 5.1.1.10.2 isof(2)
    Rule: isofExpr
    Input: isof(Category,Model.Customer)

  - Name: 5.1.1.10.2 isof(2), no namespace
    Rule: isofExpr
    Input: isof(Category,Customer)

  - Name: 5.1.1.10.2 isof(2)
    Rule: isofExpr
    Input: isof(Location,Edm.GeographyPoint)

  - Name: 5.1.1.11.1 geo.distance
    Rule: commonExpr
    Input: geo.distance(Supplier/Location,Product/Location)

  - Name: 5.1.1.11.3 geo.intersects
    Rule: boolCommonExpr
    Input: geo.intersects(Supplier/SalesArea,Product/Location)

  - Name: 5.1.1.11.3 geo.length
    Rule: commonExpr
    Input: geo.length(Line)

  - Name: 5.1.1.11.3 geo.length
    Rule: commonExpr
    Input: geo.length(geography'SRID=0;LineString(142.1 64.1,3.14 2.78)')

  - Name: 5.1.1.12 case
    Rule: compute
    Input: $compute=case(X gt 0:1,X lt 0:-1,true:0) as SignumX

  - Name: 5.1.1.12 case - lots of unnecessary whitespace
    Rule: compute
    Input: "$compute=case( X gt 0 : 1 , X lt 0 : -1 , true : 0) as SignumX"

  - Name: 5.1.1.13 Lambda Operators
    Rule: firstMemberExpr
    Input: lambda/Completed

  - Name: 5.1.1.13 Lambda Operators
    Rule: boolCommonExpr
    Input: lambda/Name eq $it/Name

  - Name: 5.1.1.13.1 any()
    Rule: anyExpr
    Input: any()

  - Name: 5.1.1.13.1 any()
    Rule: anyExpr
    Input: any( )

  - Name: 5.1.1.13.1 any()
    Rule: anyExpr
    Input: any(lambda:true)

  - Name: 5.1.1.13.1 any()
    Rule: anyExpr
    Input: "any( lambda : true )"

  - Name: 5.1.1.13.1 any()
    Rule: commonExpr
    Input: Products/any(lambda:true)

  - Name: 5.1.1.13.1 any() - requires a path prefix
    Rule: boolCommonExpr
    FailAt: 3
    Input: any()

  - Name: 5.1.1.13.1 any() - collection with type cast
    Rule: commonExpr
    Input: DirectReports/Sales.Manager/any()
    Expect:
      - collectionNavigationExpr:/Sales.Manager/any()

  - Name: 5.1.1.13.1 any()
    Rule: commonExpr
    Input: Supplier/Products/any(lambda:true)

  - Name: 5.1.1.13.1 any()
    Rule: commonExpr
    Input: Products/any(lambda:lambda/Completed)

  - Name: 5.1.1.13.1 any()
    Rule: commonExpr
    Input: Products/any(lambda:$it/Completed)

  - Name: 5.1.1.13.2 all()
    Rule: boolCommonExpr
    Input: Products/all(lambda:true)

  - Name: 5.1.1.13.2 all() - requires path prefix
    Rule: boolCommonExpr
    FailAt: 3
    Input: all(lambda:true)

  - Name: 5.1.1.13.2 all() - must contain a lambda expression
    Rule: boolCommonExpr
    FailAt: 14
    Input: Products/all()

  - Name: 5.1.1.13.2 all()
    Rule: commonExpr
    Input: Products/all(lambda:true)

  - Name: 5.1.1.13.2 all()
    Rule: commonExpr
    Input: EmailAddresses/all(lambda:true)

  - Name: 5.1.1.14.1 primitive literal
    Rule: filter
    Input: $filter=ReleaseDate gt 2013-05-24

  - Name: 5.1.1.14.2 simple array
    Rule: commonExpr
    Input: FirstName in ["Miller","Smith"]

  - Name: 5.1.1.14.2 array with single-quoted OData strings
    Rule: commonExpr
    Input: FirstName in ["Miller",'Smith']

  - Name: 5.1.1.14.2 empty array
    Rule: commonExpr
    Input: FirstName in []

  - Name: 5.1.1.14.2 array in array of arrays
    Rule: boolCommonExpr
    Input: '["Joe","Smith"] in [["John","Doe"],["Jane","Smith"]]'

  - Name: 5.1.1.14.2 array of properties in array of arrays
    Rule: boolCommonExpr
    Input: '[FirstName,LastName] in [["John","Doe"],["Jane","Smith"]]'

  - Name: 5.1.1.14.2 comparing arrays
    Rule: boolCommonExpr
    Input: '["Milk", "Cheese"] eq ["Oranges", "Carrots", "Ginger"]'

  - Name: 5.1.1.14.2 mixed array
    Rule: commonExpr
    Input: '["Hello",42,true,false,null,''World'']'

  - Name: 5.1.1.14.2 array of property names
    Rule: commonExpr
    Input: "[FirstName,LastName]"

  - Name: 5.1.1.14.2 empty object
    Rule: commonExpr
    Input: "{}"

  - Name: 5.1.1.14.2 object with concrete values
    Rule: commonExpr
    Input: '{"FirstName":"John","LastName":"Doe","Sizes":["Large","Small"]}'

  - Name: 5.1.1.14.2 object with expression values
    Rule: commonExpr
    Input:
      '{"FirstName":Customer/FirstName,"LastName":Manager/LastName,"Sizes":[1,
      2 add 3]}'

  - Name: 5.1.1.14.2 array with 'untyped' values
    Rule: commonExpr
    Input: '[[],{},true,false,null,42,{"no property name":"value","@something":true}]'

  - Name: 5.1.1.14.4 $it
    Rule: firstMemberExpr
    Input: $it/Completed

  - Name: 5.1.1.14.4 $it
    Rule: filter
    Input: $filter=endswith($it,'.com')

  - Name: 5.1.1.14.4 $it with alias for entity reference
    Rule: queryOptions
    Input: $filter=$it eq @ref&@ref={"@odata.id":"http://host/service/ZqV5t"}

  - Name: 5.1.1.14.4 $it with entity reference
    Rule: queryOptions
    Input: $filter=$it eq {"@odata.id":"http://host/service/ZqV5t"}

  - Name: 5.1.1.14.5 $root
    Rule: odataRelativeUri
    Input: Employees?$filter=LastName eq $root/Employees('A1245')/LastName

  - Name: 5.1.1.14.5 $root with function import
    Rule: odataRelativeUri
    Input: Employees?$filter=City eq $root/TheMostPopularAddress()/City

  - Name: 5.1.1.14.5 $root in array expression
    Rule: odataRelativeUri
    Input: ProductsOrderedBy(Customers=@c)?@c=[$root/Customers('ALFKI'),$root/Customers('BLAUS')]

  - Name: 5.1.1.14.5 $root with entity set
    Rule: commonExpr
    Input: $root/SalesOrganizations

  - Name: $root with bound function call
    Rule: odataRelativeUri
    Input: Suppliers?$filter=$root/Sales/Special.MostPopularCategory(Where=ZipCode) eq 'Food'

  - Name: $root with unbound function call
    Rule: odataRelativeUri
    Input: Suppliers?$filter=Special.MostPopularCategory(What=$root/Sales,Where=ZipCode) eq 'Food'

  - Name: 5.1.1.14.6 $this
    Rule: boolCommonExpr
    Input: $this eq 'Hugo'

  - Name: 5.1.1.14.6 $this
    Rule: filter
    Input: $filter=endswith($this,'.com')

  - Name: 5.1.1.14.6 $this
    Rule: odataRelativeUri
    Input: Customers?$select=EmailAddresses($filter=endswith($this,'.com'))

  - Name: 5.1.1.14.6 $this
    Rule: odataRelativeUri
    Input: Customers?$select=Addresses($filter=endswith($this/Street,'gasse'))

  - Name: 5.1.1.14.6 $this
    Rule: odataRelativeUri
    Input: Customers?$select=Addresses(@a=$this;$filter=endswith(@a/Street,'gasse'))

  - Name: 5.1.1.15 Path expressions
    Rule: commonExpr
    Input: Items

  - Name: 5.1.1.15 Path expressions - key access after set navigation
    Rule: commonExpr
    Input: Items(1)

  - Name: 5.1.1.16 Annotation Values
    Rule: filter
    Input: $filter=Price/@Measures.Currency eq 'EUR'

  - Name: 5.1.1.16 Annotation Values, no namespace
    Rule: filter
    Input: $filter=Price/@Currency eq 'EUR'

  - Name: 5.1.1.16 Annotation Values
    Rule: orderBy
    Input: $orderby=Price/@Measures.Currency

  - Name: 5.1.1.16 Annotation Values with qualifier
    Rule: orderBy
    Input: $orderby=Price/@Measures.Currency%23Reporting

  - Name: 5.1.1.16 Annotation Values with qualifier, no namespace
    Rule: filter
    Input: $filter=Price/@Currency%23Reporting eq 'EUR'

  - Name: 5.1.1.16 Annotation Values
    Rule: filter
    Input: $filter=@Core.Messages/any(m:m/severity eq 'error')

  - Name: 5.1.1.16 Annotation Values
    Rule: compute
    Input: $compute=@Core.Messages as CoreMessages

  - Name: 5.1.1.16 Annotation Values
    Rule: queryOptions
    Input: $compute=@Core.Messages as
      _at_Core_dot_Messages&$select=_at_Core_dot_Messages($top=5)

  - Name: 5.1.1.16 Annotation Values
    Rule: filter
    Input: $filter=@Messages/any(m:m/severity eq 'error')

  - Name: 5.1.2 Expand - single navigation property
    Rule: expand
    Input: $expand=Items

  - Name: 5.1.2 Expand - $ is optional
    Rule: expand
    Input: expand=Items

  - Name: 5.1.2 Expand - single navigation property
    Rule: expand
    Input: $expand=Items/$ref

  - Name: 5.1.2 Expand - multiple navigation properties
    Rule: expand
    Input: $expand=Customer,Items

  - Name: 5.1.2 Expand - multiple navigation properties
    Rule: expand
    Input: $expand=Customer/$ref,Items

  - Name: 5.1.2 Expand - multiple navigation properties, nested
    Rule: expand
    Input: $expand=Customer,Items($expand=Product)

  - Name: 5.1.2 Expand - multiple navigation properties, nested - no $ prefix
    Rule: expand
    Input: expand=Customer,Items(expand=Product)

  - Name: 5.1.2 Expand - recursive expansion
    Rule: expand
    Input: $expand=Customer($levels=4)

  - Name: 5.1.2 Expand - recursive expansion - no $ prefix
    Rule: expand
    Input: expand=Customer(levels=4)

  - Name: 5.1.2 Expand - multiple navigation properties, nested
    Rule: expand
    Input: $expand=Customer,Items($expand=Product/$ref)

  - Name: 5.1.2 Expand - no $level after $ref
    Rule: expand
    FailAt: 22
    Input: $expand=Customer/$ref($levels=4)

  - Name: 5.1.2 Expand - no $select after $ref
    Rule: expand
    FailAt: 22
    Input: $expand=Customer/$ref($select=Name)

  - Name: 5.1.2 Expand - no $expand after $ref
    Rule: expand
    FailAt: 28
    Input: $expand=Customer,Items/$ref($expand=Product)

  - Name: 5.1.2 Expand - $count
    Rule: expand
    Input: $expand=Items($count=true)

  - Name: 5.1.2 Expand - $count
    Rule: expand
    Input: $expand=Items/$count

  - Name: 5.1.2 Expand - $count
    Rule: expand
    Input: $expand=Items/$count($filter=Name eq 'Hugo')

  - Name:
      5.1.2 Expand - $count - no $ prefix for query options, still required for
      path segment
    Rule: expand
    Input: expand=Items/$count(filter=Name eq 'Hugo')

  - Name: 5.1.2 Expand - $count
    Rule: expand
    Input: $expand=Items/$count($search=Hugo)

  - Name: 5.1.2 Expand - $count
    Rule: expand
    Input: expand=Items/$count(search=Hugo)

  - Name: 5.1.2 Expand - no $count after $count
    Rule: expand
    FailAt: 21
    Input: $expand=Items/$count($count=true)

  - Name: 5.1.2 Expand - multiple nested options
    Rule: expand
    Input: $expand=Items($select=Quantity;$expand=Product($select=Name,Price);@c=15)

  - Name: 5.1.2 Expand - navigation property in complex type
    Rule: expand
    Input: $expand=Address/Country

  - Name: 5.1.2 Expand - navigation property in collection of complex type
    Rule: expand
    Input: $expand=Addresses/Country

  - Name: 5.1.2 Expand - levels
    Rule: expand
    Input: $expand=Category($levels=4),Category($levels=max)

  - Name: 5.1.2 Expand - levels without leading zeroes
    Rule: expand
    FailAt: 25
    Input: $expand=Category($levels=04)

  - Name: 5.1.2 Expand - star
    Rule: expand
    Input: $expand=*,*/$ref,*($levels=2),Category

  - Name: 5.1.2 Expand - star on complex path
    Rule: expand
    Input: $expand=Address/*,Address/Address/*,Addresses/*,Address/Model.AddressWithLocation/*,Model.VipCustomer/Address/*

  - Name: 5.1.2 Expand - star on complex path with $ref and $levels
    Rule: expand
    Input: $expand=Address/*/$ref,Address/*($levels=max)

  - Name: 5.1.2 Expand - stream property
    Rule: expand
    Input: $expand=$value,Thumbnail

  - Name: 5.1.2 Expand - annotation
    Rule: expand
    Input: $expand=@Namespace.EntityTerm

  - Name: 5.1.2 Expand - annotation with nested query options
    Rule: expand
    Input: $expand=@Namespace.EntityTerm($top=2)

  - Name: 5.1.2 Expand - annotation with navigation property
    Rule: expand
    Input: $expand=@Namespace.SomeTerm/Products($top=2)

  - Name: 5.1.3 Select - simple
    Rule: select
    Input: $select=Rating,ReleaseDate

  - Name: 5.1.3 Select - $ is optional
    Rule: select
    Input: select=Rating,ReleaseDate

  - Name: 5.1.3 Select - with star
    Rule: select
    Input: $select=*

  - Name: 5.1.3 Select - with property of complex property
    Rule: select
    Input: $select=Address/Street

  - Name: 5.1.3 Select - with property of complex property
    Rule: select
    Input: $select=Address/Country

  - Name: 5.1.3 Select - with cast
    Rule: select
    Input: $select=Address/Model.AddressWithLocation

  - Name: 5.1.3 Select - with cast and property of complex property
    Rule: select
    Input: $select=Address/Model.AddressWithLocation/Location

  - Name: 5.1.3 Select - with cast and property of complex property, no namespace
    Rule: select
    Input: $select=Address/AddressWithLocation/Location

  - Name: 5.1.3 Select on complex resource - with cast and property of sub-type
    Rule: select
    Input: $select=Model.AddressWithLocation/Location

  - Name:
      5.1.3 Select on complex resource - with cast and property of sub-type, no
      namespace
    Rule: select
    Input: $select=AddressWithLocation/Location

  - Name: 5.1.3 Select - with expand
    Rule: queryOptions
    Input: $expand=Category($select=Name)

  - Name: 5.1.3 Select - qualifiedEntityTypeName
    Rule: select
    Input: $select=Model.PreferredSupplier/Name

  - Name: 5.1.3 Select - actions by namespace
    Rule: select
    Input: $select=Model.ActionName,Model.MostPopularName,Model.*

  - Name: 5.1.3 Select - actions and functions with signature
    Rule: select
    Input: $select=Model.ActionName,Model.MostPopularName(Location,Kind)

  - Name: 5.1.3 Select - actions and functions with signature, no  namespace
    Rule: select
    Input: $select=ActionName,MostPopularName(Location,Kind)

  - Name: 5.1.3 Select - tricky
    Rule: select
    Input: $select=Namespace.PreferredSupplier/AccountRepresentative,Address/Street,Address/Namespace.AddressWithLocation/Location

  - Name: 5.1.3 Select - tricky, no namespace
    Rule: select
    Input: $select=PreferredSupplier/AccountRepresentative,Address/Street,Address/AddressWithLocation/Location

  - Name: 5.1.3 Select - nested select
    Rule: select
    Input: $select=Address($select=Street,City,Namespace.AddressWithLocation/Location)

  - Name: 5.1.3 Select - nested filter etc.
    Rule: queryOptions
    Input: $select=Addresses($filter=startswith(City,'H');$top=5;$skip=0;$count=true;$orderby=$it;$search=blue;@c=15)&$expand=Addresses/Country

  - Name: 5.1.3 Select - annotations
    Rule: select
    Input: $select=@Core.Messages($top=5)

  - Name: 5.1.3 Select - annotations
    Rule: select
    Input: $select=Address/@Core.Messages($top=5)

  - Name: 5.1.3 Select - annotations
    Rule: select
    Input: $select=@Measures.Currency,@Core.MayImplement($top=2)

  - Name: 5.1.4 OrderBy
    Rule: orderby
    Input: $orderby=Name

  - Name: 5.1.4 OrderBy - case-insensitive
    Rule: orderby
    Input: $OrderBy=Name

  - Name: 5.1.4 OrderBy - $ is optional
    Rule: orderby
    Input: OrderBy=Name

  - Name: 5.1.4 OrderBy asc
    Rule: orderby
    Input: $orderby=Name	asc

  - Name: 5.1.4 OrderBy mixed
    Rule: orderby
    Input: $orderby=Name asc,Rating,ReleaseDate desc

  - Name: 5.1.4 OrderBy expression
    Rule: orderby
    Input: $orderby=Cost ge Revenue asc

  - Name: 5.1.5 Top and Skip
    Rule: queryOptions
    Input: $top=5&$skip=10

  - Name: 5.1.5 Top and Skip - $ is optional
    Rule: queryOptions
    Input: top=5&skip=10

  - Name: 5.1.6 Inlinecount
    Rule: queryOptions
    Input: $count=true

  - Name: 5.1.6 Inlinecount - $ is optional
    Rule: queryOptions
    Input: count=true

  - Name: 5.1.6 Inlinecount
    Rule: queryOptions
    Input: $count=false

  - Name: 5.1.6 Inlinecount
    Rule: queryOptions
    FailAt: 6
    Input: $count

  - Name: 5.1.7 Search - simple term
    Rule: queryOptions
    Input: $search=blue

  - Name: 5.1.7 Search - simple term
    Rule: queryOptions
    Input: $search=1984

  - Name: 5.1.7 Search - simple term
    Rule: queryOptions
    Input: $search=2x4

  - Name: 5.1.7 Search - simple term with dot
    Rule: queryOptions
    Input: $search=3.14

  - Name: 5.1.7 Search - simple term with comma
    Rule: queryOptions
    Input: $search=9,81

  - Name: 5.1.7 Search - simple term with dash
    Rule: queryOptions
    Input: $search=brand-new

  - Name: 5.1.7 Search - simple term with quote
    Rule: queryOptions
    Input: $search=Daniel's

  - Name: 5.1.7 Search - simple term with underscore
    Rule: queryOptions
    Input: $search=__FILE__

  - Name: 5.1.7 Search - simple term with dollar
    Rule: queryOptions
    Input: $search=$search

  - Name: 5.1.7 Search - simple term with slash
    Rule: queryOptions
    Input: $search=08/15

  - Name: 5.1.7 Search - simple term with unencoded hash
    Rule: queryOptions
    FailAt: 8
    Input: $search=#1

  - Name: 5.1.7 Search - simple term with percent-encoded hash (#)
    Rule: queryOptions
    Input: $search=%231

  - Name: 5.1.7 Search - simple term with unencoded ampersand
    Rule: queryOptions
    FailAt: 17
    Input: $search=more&more

  - Name: 5.1.7 Search - simple term with percent-encoded ampersand
    Rule: queryOptions
    Input: $search=more%26more

  - Name: 5.1.7 Search - simple term with unencoded semicolon
    Rule: queryOptions
    FailAt: 9
    Input: $search=a;b

  - Name: 5.1.7 Search - simple term with percent-encoded semicolon
    Rule: queryOptions
    Input: $search=a%3Bb

  - Name: 5.1.7 Search - AND is a word here, not an operator
    Rule: queryOptions
    Input: $search=AND

  - Name: 5.1.7 Search - OR is a word here, not an operator
    Rule: queryOptions
    Input: $search=OR

  - Name: 5.1.7 Search - NOT is a word here, not an operator
    Rule: queryOptions
    Input: $search=NOT

  - Name:
      5.1.7 Search - NOT is an operator here, search for items that do not match
      blue
    Rule: queryOptions
    Input: $search=NOT blue

  - Name:
      5.1.7 Search - NOT is an operator here, search for items that do not match
      blue
    Rule: queryOptions
    Input: $search=NOT (blue green)

  - Name:
      5.1.7 Search - the first NOT is an operator, the second a word, search for
      items that do not match NOT
    Rule: queryOptions
    Input: $search=NOT NOT

  - Name:
      5.1.7 Search - AND and OR are words here, search for items that match both
      AND and OR
    Rule: queryOptions
    Input: $search=AND OR

  - Name:
      5.1.7 Search - AND and OR are words here, search for items that match both
      AND and OR
    Rule: queryOptions
    Input: $search=OR AND

  - Name:
      5.1.7 Search - AND and NOT are words here, search for items that match AND
      or NOT
    Rule: queryOptions
    Input: $search=AND OR NOT

  - Name: 5.1.7 Search - $ is optional
    Rule: queryOptions
    Input: search=blue

  - Name: 5.1.7 Search - simple phrase
    Rule: queryOptions
    Input: $search="blue%20green"

  - Name: 5.1.7 Search - simple phrase
    Rule: search
    Input: $search="blue green"

  - Name: 5.1.7 Search - phrase with unbalanced double-quotes
    Rule: queryOptions
    Input: $search='"blue'

  - Name: 5.1.7 Search - phrase with unbalanced double-quotes
    Rule: search
    FailAt: 13
    Input: $search="blue

  - Name: 5.1.7 Search - phrase with unbalanced double-quotes
    Rule: search
    FailAt: 15
    Input: $search=%22blue

  - Name: 5.1.7 Search - phrase with unbalanced double-quotes - still ok
    Rule: queryOptions
    Input: $search='"blue" "green'

  - Name: 5.1.7 Search - phrase with double-quote without whitespace
    Rule: searchExpr
    FailAt: 8
    Input: '"blue%22green'

  - Name: 5.1.7 Search - implicit AND
    Rule: queryOptions
    Input: $search=blue green

  - Name: 5.1.7 Search - implicit AND, encoded
    Rule: queryOptions
    Input: $search=blue%20green

  - Name: 5.1.7 Search - leading space
    Rule: queryOptions
    Input: $search=%20blue
    Expect:
      - searchWord:blue

  - Name: 5.1.7 Search - trailing space
    Rule: queryOptions
    Input: $search=blue%20&!special
    Expect:
      - searchWord:blue
      - customQueryOption:!special

  - Name: 5.1.7 Search - space in search phrase
    Rule: queryOptions
    Input: $search=%20"%20"%20-%20
    Expect:
      - searchPhrase:"%20"
      - searchWord:-

  - Name: 5.1.7 Search - AND
    Rule: queryOptions
    Input: $search=blue AND green

  - Name: 5.1.7 Search - OR
    Rule: queryOptions
    Input: $search=blue OR green

  - Name: 5.1.7 Search - NOT
    Rule: queryOptions
    Input: $search=blue NOT green

  - Name: 5.1.7 Search - only NOT
    Rule: queryOptions
    Input: $search=NOT blue

  - Name: 5.1.7 Search - multiple
    Rule: queryOptions
    Input: $search=foo AND bar OR foo AND baz OR that AND bar OR that AND baz

  - Name: 5.1.7 Search - multiple
    Rule: searchExpr
    Input: (foo OR that) AND (bar OR baz) AND NOT quux

  - Name: 5.1.7 Search - grouping
    Rule: queryOptions
    Input: $search=foo AND (bar OR baz)

  - Name: 5.1.7 Search - grouping
    Rule: queryOptions
    Input: $search=(foo AND bar) OR baz

  - Name: 5.1.7 Search - grouping
    Rule: queryOptions
    Input: $search=(NOT foo) OR baz

  - Name: 5.1.7 Search - grouping
    Rule: queryOptions
    Input: $search=(NOT foo)

  - Name: "5.1.7 Search - UTF-8 characters: Greek Capital Letter Delta (Δ)"
    Rule: queryOptions
    Input: $search=%CE%94

  - Name: 5.1.7 Search - incomplete expressions
    Rule: queryOptions
    Input: $search='"'

  - Name: 5.1.7 Search - incomplete expressions
    Rule: queryOptions
    Input: $search='"bl'

  - Name: 5.1.7 Search - incomplete expressions
    Rule: queryOptions
    Input: $search='"blue%20p'

  - Name: 5.1.7 Search - incomplete expressions
    Rule: queryOptions
    Input: $search='('

  - Name: 5.1.7 Search - nested $search may contain balanced parentheses
    Rule: queryOptions
    Input: $expand=Manager($search=(green))

  - Name: 5.1.7 Search - nested $search must not contain unbalanced parentheses
    Rule: queryOptions
    FailAt: 26
    Input: $expand=Manager($search=gr(een)

  - Name: 5.1.7 Search - nested $search must not contain unbalanced parentheses
      unless single-quoted
    Rule: queryOptions
    Input: $expand=Manager($search='gr(een')

  - Name: 5.1.7 Search - nested $search simple term with percent-encoded semicolon
    Rule: queryOptions
    Input: $expand=Manager($search=a%3Bb)

  - Name: 5.1.7 Search - nested $search simple term with percent-encoded semicolon
    Rule: queryOptions
    Input: $expand=Manager($search='a%3Bb')

  - Name: 5.1.7 Search - on entity set
    Rule: odataUri
    Input: http://serviceRoot/Products?$search=blue

  - Name: 5.1.7 Search - on entity container
    Rule: odataUri
    Input: http://serviceRoot/Model.Container/$all?$search=blue

  - Name: 5.1.7 Search - on service
    Rule: odataUri
    Input: http://serviceRoot/$all?$search=blue

  - Name: 5.1.8 Format
    Rule: queryOptions
    Input: $format=json&$Format=atom&$format=xml&$format=text/html

  - Name: 5.1.8 Format - $ is optional
    Rule: queryOptions
    Input: format=json

  - Name: 5.1.8 Format - value is case-insensitive
    Rule: queryOptions
    Input: $format=JSON&$format=Atom&$format=XML&$format=text/html

  - Name: 5.1.8 Format - media type
    Rule: queryOptions
    Input: $format=text/html

  - Name: 5.1.9 Index
    Rule: queryOptions
    Input: $index=42

  - Name: 5.1.9 Index - $ is optional
    Rule: queryOptions
    Input: index=42

  - Name: 5.1.9 Index - negative indexes allowed with V4.01
    Rule: queryOptions
    Input: index=-42

  - Name: 5.1.9 Index
    Rule: queryOptions
    FailAt: 7
    Input: $index=fortytwo

  - Name: 5.1.10 Compute
    Rule: queryOptions
    Input: $compute=Amount mul Product/TaxRate as Tax

  - Name: 5.1.10 Compute - $ is optional
    Rule: queryOptions
    Input: compute=Amount mul Product/TaxRate as Tax

  - Name: 5.1.10 Compute - many
    Rule: queryOptions
    Input: $compute=Amount mul Product/TaxRate as Tax,day(Time/Date) as WeekDay

  - Name: 5.1.10 Compute - within $expand
    Rule: queryOptions
    Input: $expand=Sales($compute=Amount mul Product/TaxRate as Tax)

  - Name: Delta Link
    Rule: deltatoken
    Input: $deltatoken=A@Lot_Has:Changed?=Here!

  - Name: Next Link
    Rule: skiptoken
    Input: $skiptoken=Start@Next_Chunk:From?=Here!

  - Name: "Next Link: no Ampersand"
    Rule: skiptoken
    FailAt: 14
    Input: $skiptoken=Not&this

  - Name: 5.2 Custom Query Option
    Rule: customQueryOption
    Input: find=O%27Neil

  - Name: 5.2 Custom Query Option
    Rule: customQueryOption
    Input: "!deltatoken='201208210403'"

  - Name: 5.2 Custom Query Option
    Rule: customQueryOption
    Input: "!special"

  - Name: 5.2 Custom Query Option
    Rule: queryOptions
    Input: find=O%27Neil&!special

  - Name: 5.2 Custom Query Option
    Rule: queryOptions
    Input: $orderby=Name&!deltatoken=0412312321

  - Name: 5.3 Parameter Aliases
    Rule: queryOptions
    Input: $filter=contains(Title,@word)&@word='Black'

  - Name: 5.3 Parameter Aliases
    Rule: queryOptions
    Input: $filter=Title eq @title&@title='Wizard%20of%20Oz'

  - Name: 5.3 Parameter Aliases
    Rule: odataRelativeUri
    Input: Products/Model.WithIngredients(Ingredients=@i)?@i=["Carrots","Ginger","Oranges"]

  - Name: 5.3 Parameter Aliases
    Rule: odataRelativeUri
    Input: Categories?$expand=Products(@foo=$this;$filter=@foo/Price gt 3)

  - Name: 5.3 Parameter Aliases
    Rule: odataRelativeUri
    Input:
      Employees?$expand=Manager(@m=$this;$expand=DirectReports($filter=@m/FirstName
      eq FirstName))

  - Name: function with complex parameter - no properties
    Rule: odataRelativeUri
    Input: ProductsByComplex(complex=@c)?@c={}

  - Name: function with complex parameter - one property
    Rule: odataRelativeUri
    Input: ProductsByComplex(complex=@c)?@c={"Name":"Value"}

  - Name: function with complex parameter - one property
    Rule: odataRelativeUri
    Input: ProductsByComplex(complex=@c)?@c={"@odata.type":"Model.Customer","Name":"Value"}

  - Name: function with complex parameter - three properties
    Rule: odataRelativeUri
    Input: ProductsByComplex(complex=@c)?@c={"Name":false,"Price":3.14e0,"Rating":null}

  - Name: function with collection of primitive - zero
    Rule: odataRelativeUri
    Input: ProductsByColor(colors=@c)?@c=[]

  - Name: function with collection of primitive - one
    Rule: odataRelativeUri
    Input: ProductsByColor(colors=@c)?@c=["red"]

  - Name: function with collection of primitive - two
    Rule: odataRelativeUri
    Input: ProductsByColor(colors=@c)?@c=["red","green"]

  - Name: function with complex parameter - complex and collection properties
    Rule: odataRelativeUri
    Input: ProductsByComplex(complex=@c)?@c={"Names":["Fred","George"],"Address":{"Street":"MyWay"}}

  - Name: function with rootExpr
    Rule: odataRelativeUri
    Input: ProductsByCustomer(customer=@c)?@c=$root/Customers(1)

  - Name: function with rootExpr - single navigation
    Rule: odataRelativeUri
    Input: ProductsByCustomer(customer=@c)?@c=$root/Customers(1)/Model.VipCustomer/AccountRepresentative

  - Name: function with rootExpr - array
    Rule: odataRelativeUri
    Input: ProductsByCustomer(customer=@c)?@c=[$root/Customers(1),$root/Customers(2)]

  - Name: function with rootExpr - complex with single navigation
    Rule: odataRelativeUri
    Input: ProductsByCustomer(customer=@c)?@c={"Country":$root/Countries('DE')}

  - Name: function with rootExpr - complex with collection navigation
    Rule: odataRelativeUri
    Input: ProductsByCustomer(customer=@c)?@c={"Orders":[$root/Orders(1)]}

  - Name: Enumeration literal in URI
    Rule: enumLiteral
    Input: Sales.Pattern'Yellow'

  - Name: Enumeration literal in URI - without prefix
    Rule: enumLiteral
    Input: "'Yellow'"

  - Name: Enumeration literal in URI - multiple flag values
    Rule: enumLiteral
    Input: Sales.Pattern'Solid,Yellow'

  - Name: Enumeration literal in URI - multiple flag values
    Rule: enumLiteral
    Input: Sales.Pattern'Solid%2CYellow,%2B42'

  - Name: Enumeration literal in URI - multiple flag values without prefix
    Rule: enumLiteral
    Input: "'Solid,Yellow,-42'"

  - Name: Enumeration literal - in filter
    Rule: filter
    Input: $filter=style eq Sales.Pattern'Yellow'

  - Name: Enumeration literal - in filter without prefix
    Rule: filter
    Input: $filter=style eq 'Yellow'

  - Name: Enumeration literal - in filter with has
    Rule: filter
    Input: $filter=style has Sales.Pattern'Yellow'

  - Name: Enumeration literal - undefined value as numeric constant
    Rule: filter
    Input: $filter=style has Sales.Pattern'32'

  - Name: Enumeration literal - undefined value as numeric constant
    Rule: odataRelativeUri
    Input: Products?$filter=style eq Sales.Pattern'Yellow,32'

  - Name: Enumeration literal - undefined value as numeric constant
    Rule: odataRelativeUri
    Input: Products?$filter=style eq cast(eyeColor,Sales.Pattern)

  - Name: Enumeration value - multiple flag values
    Rule: enumValue
    Input: "Solid,Yellow,+42"

  - Name: Enumeration value - no percent-encoding
    Rule: enumValue
    FailAt: 5
    Input: Solid%2CYellow

  - Name: Enumeration value - no percent-encoding
    Rule: enumValue
    FailAt: 0
    Input: "%2B42"

  - Name: GeographyCollection
    Rule: geographyCollection
    Input: geography'SRID=0;GeometryCollection(LineString(142.1 64.1,3.14 2.78))'

  - Name: GeographyLineString
    Rule: geographyLineString
    Input: geography'SRID=0;LineString(142.1 64.1,3.14 2.78)'

  - Name: GeographyMultiLineString
    Rule: geographyMultiLineString
    Input:
      geography'SRID=0;MultiLineString((142.1 64.1,3.14 2.78),(142.1 64.1,3.14
      2.78))'

  - Name: GeographyMultiPoint
    Rule: geographyMultiPoint
    Input: geography'SRID=0;MultiPoint()'

  - Name: GeographyMultiPoint
    Rule: geographyMultiPoint
    Input: geography'SRID=0;MultiPoint((142.1 64.1),(1 2))'

  - Name: GeographyMultiPolygon
    Rule: geographyMultiPolygon
    Input: geography'SRID=0;MultiPolygon(((1 1,1 1),(1 1,2 2,3 3,1 1)))'

  - Name: GeographyPoint
    Rule: geographyPoint
    Input: geography'SRID=0;Point(142.1 64.1)'

  - Name: GeographyPoint with elevation
    Rule: geographyPoint
    Input: geography'SRID=0;Point(142.1 64.1 10.0)'

  - Name: GeographyPoint with elevation and measure
    Rule: geographyPoint
    Input: geography'SRID=0;Point(142.1 64.1 10.0 -3.14)'

  - Name: GeographyPolygon
    Rule: geographyPolygon
    Input: geography'SRID=0;Polygon((1 1,1 1),(1 1,2 2,3 3,1 1))'

  - Name: GeometryCollection
    Rule: geometryCollection
    Input: geometry'SRID=0;GeometryCollection(LineString(142.1 64.1,3.14 2.78))'

  - Name: GeometryLineString
    Rule: geometryLineString
    Input: geometry'SRID=0;LineString(142.1 64.1,3.14 2.78)'

  - Name: GeometryMultiLineString
    Rule: geometryMultiLineString
    Input:
      geometry'SRID=0;MultiLineString((142.1 64.1,3.14 2.78),(142.1 64.1,3.14
      2.78))'

  - Name: GeometryMultiPoint
    Rule: geometryMultiPoint
    Input: geometry'SRID=0;MultiPoint()'

  - Name: GeometryMultiPoint
    Rule: geometryMultiPoint
    Input: geometry'SRID=0;MultiPoint((142.1 64.1),(1 2))'

  - Name: GeometryMultiPolygon
    Rule: geometryMultiPolygon
    Input: geometry'SRID=0;MultiPolygon(((1 1,1 1),(1 1,2 2,3 3,1 1)))'

  - Name: GeometryPoint
    Rule: geometryPoint
    Input: geometry'SRID=0;Point(142.1 64.1)'

  - Name: GeometryPolygon
    Rule: geometryPolygon
    Input: geometry'SRID=0;Polygon((1 1,1 1),(1 1,2 2,3 3,1 1))'

  - Name: $filter with geometry
    Rule: filter
    Input: $filter=geo.intersects(geometry'SRID=0;Point(142.1
      64.1)',geometry'SRID=0;Polygon((1 1,1 1),(1 1,2 2,3 3,1 1))')

  - Name: Functions in commonExpr
    Rule: commonExpr
    Input: Model.Available()

  - Name: Functions in commonExpr
    Rule: commonExpr
    FailAt: 15
    Input: Model.Available

  - Name: Functions in commonExpr - directly call function
    Rule: commonExpr
    Input: Model.MostPopularName()

  - Name: Functions in commonExpr - after collection navigation
    Rule: commonExpr
    Input: Products/Model.Available()

  - Name: Functions in commonExpr - composed functions
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Model.MostPopularName()

  - Name: Functions in commonExpr - composed functions, no namespace
    Rule: commonExpr
    Input: Products/BestProduct()/MostPopularName()

  - Name: Functions in commonExpr - singleNavigation
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Name

  - Name: Functions in commonExpr - singleNavigation
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Model.BestSellingProduct/Name

  - Name: Functions in commonExpr - singleNavigation
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Name/Model.Available()

  - Name: Functions in commonExpr - singleNavigation
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Address

  - Name: Functions in commonExpr - singleNavigation
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Address/Street

  - Name: Functions in commonExpr - singleNavigation
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Addresses

  - Name: Functions in commonExpr - singleNavigation
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Addresses/Model.MostPopularName()

  - Name: Functions in commonExpr - singleNavigation
    Rule: commonExpr
    Input: Products/Model.BestProduct()/EmailAddresses

  - Name: Functions in commonExpr - stream property
    Rule: commonExpr
    Input: Products/Model.BestProduct()/Thumbnail

  - Name: Functions in commonExpr - singleNavigation with any
    Rule: commonExpr
    Input: Products/Model.BestProduct()/EmailAddresses/any()

  - Name: Functions in commonExpr - singleNavigation with all
    Rule: commonExpr
    Input: Products/Model.BestProduct()/EmailAddresses/all(lambda:true)

  - Name: Functions in commonExpr - collectionNavigation
    Rule: commonExpr
    Input: Products/Model.ProductsByColor(color='green')/Model.MostPopularName()

  - Name: Functions in commonExpr - collectionNavigation
    Rule: commonExpr
    Input: Products/Model.ProductsByColor(color='green')/Model.BestSellingProduct/Model.MostPopularName()

  - Name: Functions in commonExpr - collectionNavigation
    Rule: commonExpr
    Input: Products/Model.ProductsByColor(color=@color)/Model.BestSellingProduct/Model.MostPopularName()

  - Name: Functions in commonExpr - collectionNavigation with all
    Rule: commonExpr
    Input: Products/Model.ProductsByColor()/all(lambda:true)

  - Name: Functions in commonExpr - complexPath
    Rule: commonExpr
    Input: Items/Model.MostPopularAddress()/Street

  - Name: Functions in commonExpr - complexPath
    Rule: commonExpr
    Input: Items/Model.MostPopularAddress()/Address

  - Name: Functions in commonExpr - complexPath
    Rule: commonExpr
    Input: Items/Model.MostPopularAddress()/Address/Model.Available()

  - Name: Functions in commonExpr - collectionPath
    Rule: commonExpr
    Input: Items/Model.MostPopularAddresses()/$count

  - Name: Functions in commonExpr - collectionPath
    Rule: commonExpr
    Input: Items/Model.MostPopularAddresses()/Model.MostPopularName()

  - Name: Functions in commonExpr - collectionPath
    Rule: commonExpr
    Input: Items/Model.MostPopularNames()/$count

  - Name: Functions in commonExpr - collectionPath
    Rule: commonExpr
    Input: Items/Model.MostPopularNames()/Model.MostPopularName()

  - Name: Functions in commonExpr - collectionPath, no namespace
    Rule: commonExpr
    Input: Items/MostPopularNames()/MostPopularName()

  - Name: Functions in commonExpr - singlePath
    Rule: commonExpr
    Input: Items/Model.MostPopularName()/Model.MostPopularName()

  - Name: Functions in commonExpr - singlePath, no namespace
    Rule: commonExpr
    Input: Items/MostPopularName()/MostPopularName()

  - Name: Functions in commonExpr - collection parameter in JSON
    Rule: commonExpr
    Input: Products/Model.ProductsByColor(colors=["red","green","blue"])

  - Name: Functions in commonExpr - collection parameter in JSON with whitespace
    Rule: commonExpr
    Input: Products/Model.ProductsByColor(colors=[ "red", "green" , "blue" ])

  - Name: Functions in commonExpr - collection parameter in JSON with whitespace
    Rule: commonExpr
    Input: Products/Model.ProductsByColor(colors=%5B%20"red",%20"green"%20,"blue"%20%5D)

  - Name: Functions in commonExpr - complex JSON parameter
    Rule: commonExpr
    Input: Model.Available(complex={"Name":"Value"})

  - Name: Functions in commonExpr - complex JSON parameter with whitespace
    Rule: commonExpr
    Input: 'Model.Available(complex={ "Name" : "double quote (\") in value" })'

  - Name: Functions in commonExpr - complex JSON parameter with whitespace
    Rule: commonExpr
    Input: 'Model.Available(complex=%7B %22Name%22 : "double%20quote (%5C%22) in
      value" %7D)'

  - Name: Functions in commonExpr - property as parameter
    Rule: commonExpr
    Input: Model.PhoneticallySimilar(Word1=Name,Word2=Supplier/Name)

  - Name: in operator with list of primitives
    Rule: commonExpr
    Input: FirstName in ('Miller','Smith')

  - Name: lists can only contain primitive literals
    Rule: commonExpr
    FailAt: 23
    Input: FirstName in (FirstName,LastName)

  - Name: right operand is not a list, it's a complicated way of writing FirstName
    Rule: commonExpr
    Input: FirstName in (FirstName)

  - Name: in operator with empty literal list
    Rule: commonExpr
    Input: FirstName in ()

  - Name: common expression cannot be empty
    Rule: commonExpr
    FailAt: 0
    Input: ""

  - Name: lists only allowed right of in operator
    Rule: commonExpr
    FailAt: 27
    Input: EmailAddresses eq ('Miller','Smith')

  - Name: Functions in filter - alias as parameter
    Rule: queryOptions
    Input: $filter=Model.PhoneticallySimilar(Word=@expression)&@expression=5 add 3

  - Name: Functions in filter - expression as parameter
    Rule: queryOptions
    Input: $filter=Model.PhoneticallySimilar(Number=5 add 3)

  - Name: Functions in filter - $it as prefix
    Rule: queryOptions
    Input: $filter=$it/Model.PhoneticallySimilar(Number=5 add 3)

  - Name: Context URL - Entity set
    Rule: odataUri
    Input: http://host/service/$metadata#Customers

  - Name: Context URL - Entity set with $select
    Rule: odataRelativeUri
    Input: $metadata#Customers(Address,Orders)

  - Name: Context URL - Entity set with $select
    Rule: context
    Input: "#Customers(Address/Street,Orders)"

  - Name: Context URL - Entity set with $select
    Rule: context
    Input: "#Customers(Address/Country)"

  - Name: Context URL - Entity set with $select and type-cast
    Rule: context
    Input: "#Customers(Address/Model.AddressWithLocation,Orders)"

  - Name: Context URL - Entity set with $select and type-cast, qualifier is required
    Rule: context
    FailAt: 38
    Input: "#Customers(Address/AddressWithLocation,Orders)"

  - Name: Context URL - Entity set with $select
    Rule: context
    Input: "#Customers(Address/Name,Orders)"

  - Name: Context URL - Entity set with $select
    Rule: context
    Input: "#Customers/Model.VipCustomer(Orders(ID))"

  - Name: Context URL - Entity set with $select and type cast
    Rule: context
    Input: "#Customers(Name,Address/Country,Model.VipCustomer/Rating)"

  - Name: Context URL - Entity set with $select and $expand
    Rule: context
    Input: "#Customers/Model.VipCustomer(Name,Address/Country,Model.*)"

  - Name: Context URL - Entity set with $select and $expand with nested select
    Rule: context
    Input:
      "#Customers/Model.VipCustomer(Name,Address/Country(Code,Model.ActionName\
      ,Model.MostPopularAddress))"

  - Name: Context URL - Entity set with $select and $expand
    Rule: context
    Input: "#Customers/Model.VipCustomer(Orders,Orders())"

  - Name: Context URL - Entity set with $select and $expand with nested select
    Rule: context
    Input: "#Customers/Model.VipCustomer(Orders,Orders(ID,Items(Price)))"

  - Name: Context URL - Entity with $select and $expand with nested select
    Rule: context
    Input: "#Customers/Model.VipCustomer(*,Orders(ID))/$entity"

  - Name: Context URL - Entity set with cast, $select and recursive $expand
    Rule: context
    Input: "#Employees(Title,DirectReports+(FirstName,LastName))"

  - Name: Context URL - Collection of structured type with $select and recursive
      $expand
    Rule: context
    Input: "#Collection(Model.Employee)(Title,DirectReports+(FirstName,LastName))"

  - Name: Context URL - annotations in select
    Rule: context
    Input:
      "#Employees(@Core.Messages,Title,DirectReports+(@Core.Messages,FirstName\
      ,LastName))"

  - Name: "Context URL - annotations in select - cleartext #"
    Rule: context
    Input:
      "#Employees(@Core.Messages/code,@Core.Messages/message,Title,DirectRepor\
      ts+(@Core.Messages#second,FirstName,LastName))"

  - Name: "Context URL - annotations in select - # must be cleartext, not
      percent-encoded"
    Rule: context
    FailAt: 89
    Input:
      "#Employees(@Core.Messages/code,@Core.Messages/message,Title,DirectRepor\
      ts+(@Core.Messages%23second,FirstName,LastName))"

  - Name: Context URL - annotations in expand
    Rule: context
    Input: "#Employees(@Namespace.EntityTerm(FirstName,LastName))"

  - Name: Context URL - Entity set with type cast
    Rule: context
    Input: "#Customers/Model.VipCustomer"

  - Name: Context URL - Entity
    Rule: context
    Input: "#Customers/$entity"

  - Name: Context URL - Singleton
    Rule: context
    Input: "#SingletonEntity"

  - Name: Context URL - Singleton with containment
    Rule: context
    Input: "#SingletonEntity/Orders"

  - Name: Context URL - Singleton with containment
    Rule: context
    Input: "#SingletonEntity/Orders(3)/Items"

  - Name: Context URL - collection with containment
    Rule: context
    Input: "#Customers('ALFKI')/Orders"

  - Name: Context URL - containment
    Rule: context
    Input: "#Customers('ALFKI')/Orders/$entity"

  - Name: Context URL - collection with containment - multi-level
    Rule: context
    Input: "#Customers('ALFKI')/Orders(1)/Items"

  - Name: Context URL - containment - multi-level with $select
    Rule: context
    Input: "#Customers('ALFKI')/Orders(1)/Items(Product)/$entity"

  - Name: Context URL - containment with type cast
    Rule: context
    Input: "#Customers('ALFKI')/Model.VipCustomer/Address/Orders"

  - Name: Context URL - Singleton with $select
    Rule: context
    Input: "#SingletonEntity(Address,Orders)"

  - Name: Context URL - Entity with $select
    Rule: context
    Input: "#Customers(Address,Orders)/$entity"

  - Name: Context URL - Entity with type cast
    Rule: context
    Input: "#Customers/Model.VipCustomer/$entity"

  - Name: Context URL - Entity property value
    Rule: context
    Input: "#Customers(1)/Addresses"

  - Name: Context URL - Entity property value with $select
    Rule: context
    Input: "#Customers(1)/Addresses(Country)"

  - Name: Context URL - Individual value
    Rule: context
    Input: "#Model.MonetaryAmount"

  - Name: Context URL - Individual collection value
    Rule: context
    Input: "#Collection(Edm.String)"

  - Name: Context URL - Reference collection
    Rule: context
    Input: "#Collection($ref)"

  - Name: Context URL - Reference
    Rule: context
    Input: "#$ref"

  - Name: Context URL - $all
    Rule: context
    Input: "#Collection(Edm.EntityType)"

  - Name: Context URL - $crossjoin
    Rule: context
    Input: "#Collection(Edm.ComplexType)"

  - Name: Context URL - Delta
    Rule: context
    Input: "#Customers/$delta"

  - Name: Context URL - Delta - deleted context
    Rule: context
    Input: "#Orders/$deletedEntity"

  - Name: Context URL - Delta - link
    Rule: context
    Input: "#Customers/$link"

  - Name: Context URL - Delta - deleted link
    Rule: context
    Input: "#Orders/$deletedLink"

  - Name: Header - AsyncResult
    Rule: header
    Input: "AsyncResult: 200"

  - Name: Header - content-id
    Rule: header
    Input: "content-id: 1"

  - Name: Batch Request - request identifier
    Rule: request-id
    Input: First-Insert~Customer_1.1

  - Name: Batch Request - request identifier
    Rule: request-id
    Input: group1

  - Name: Header - odata-entityid
    Rule: header
    Input: "odata-entityid: ralf:handl"

  - Name: Header - odata-entityid
    Rule: header
    Input: "odata-entityID: empty-path:/"

  - Name: Header - odata-entityid
    Rule: header
    Input: odata-entityId:strange:ÿ/

  - Name: Header - odata-error
    Rule: header
    Input: 'OData-error: {"code":"err123","message":"Unsupported
      functionality","target":"query","details":[{"code":"fourtytwo","target":"$search","message":"$search
      query option not supported"}]}'

  - Name: Header - odata-isolation
    Rule: header
    Input: odata-isolation:sNapShoT

  - Name: Header - isolation
    Rule: header
    Input: isolation:sNapShoT

  - Name: Header - odata-maxversion 4.0
    Rule: header
    Input: "odata-maxversion: 4.0"

  - Name: Header - odata-maxversion 4.01
    Rule: header
    Input: "odata-maxversion: 4.01"

  - Name: Header - odata-maxversion 4.02
    Rule: header
    Input: "odata-maxversion: 4.02"

  - Name: Header - odata-maxversion weird
    Rule: header
    Input: odata-maxversion:06.2831852000

  - Name: Header - odata-version 4.0
    Rule: header
    Input: "odata-version: 4.0"

  - Name: Header - odata-version 4.01
    Rule: header
    Input: "odata-version: 4.01"

  - Name: Header - odata-version 4.02
    Rule: header
    Input: "odata-version: 4.02"

  - Name: Preferences - allow entity references and maximum page size
    Rule: prefer
    Input: "Prefer: odata.allow-entityreferences,odata.maxpagesize=20"

  - Name: Preferences - allow entity references and maximum page size - no prefix
    Rule: prefer
    Input: "Prefer: allow-entityreferences,maxpagesize=20"

  - Name: Preferences - callback
    Rule: preference
    Input: odata.callback;url="please://call/me?back#here"

  - Name: Preferences - callback
    Rule: preference
    Input: odata.callback;url="http://myserver/notfication/token/12345"

  - Name: Preferences - callback
    Rule: preference
    Input: odata.callback;url="some:where"

  - Name: Preferences - callback
    Rule: preference
    Input: odata.callback;url="some:/where"

  - Name: Preferences - without prefix
    Rule: preference
    Input: callback;url="some:/where"

  - Name: Preferences - continue on error
    Rule: preference
    Input: odata.continue-on-error

  - Name: Preferences - continue on error - no prefix
    Rule: preference
    Input: continue-on-error

  - Name: Preferences - continue on error with value true
    Rule: preference
    Input: odata.continue-on-error=true

  - Name: Preferences - continue on error with value true
    Rule: preference
    Input: continue-on-error=true

  - Name: Preferences - continue on error with value false
    Rule: preference
    Input: odata.continue-on-error=false

  - Name: Preferences - continue on error with value false
    Rule: preference
    Input: continue-on-error=false

  - Name: Preferences - include annotations - all
    Rule: preference
    Input: odata.include-annotations="*"

  - Name: Preferences - include annotations - all with a given qualifier
    Rule: preference
    Input: odata.include-annotations="*#qualified"

  - Name: Preferences - include annotations - none
    Rule: preference
    Input: odata.include-annotations="-*"

  - Name: Preferences - include annotations - none with a given qualifier
    Rule: preference
    Input: odata.include-annotations="-*#qualified"

  - Name: Preferences - include annotations - all in namespace
    Rule: preference
    Input: odata.include-annotations="Namespace.*"

  - Name: Preferences - include annotations - all in namespace with given qualifier
    Rule: preference
    Input: odata.include-annotations="Namespace.*#quali"

  - Name: Preferences - include annotations - namespace must be suffixed with .*
    Rule: includeAnnotationsPreference
    FailAt: 36
    Input: odata.include-annotations="Namespace"

  - Name: Preferences - include annotations - namespace must be suffixed with .*
    Rule: includeAnnotationsPreference
    FailAt: 37
    Input: odata.include-annotations="Namespace."

  - Name: Preferences - include annotations - nothing from namespace
    Rule: preference
    Input: odata.include-annotations="-Namespace.*"

  - Name: Preferences - include annotations - nothing from namespace
    Rule: preference
    Input: odata.include-annotations="-Namespace.*#quali"

  - Name: Preferences - include annotations - only a special term
    Rule: preference
    Input: odata.include-annotations="Namespace.SomeTerm"

  - Name: Preferences - include annotations - only a special term
    Rule: preference
    Input: odata.include-annotations="Namespace.SomeTerm#qual"

  - Name: Preferences - include annotations - everything except a special term
    Rule: preference
    Input: odata.include-annotations="-Namespace.SomeTerm"

  - Name: Preferences - include annotations - only a special term
    Rule: preference
    Input: odata.include-annotations="-Namespace.SomeTerm#qual"

  - Name: Preferences - include annotations - several
    Rule: preference
    Input: odata.include-annotations="Namespace.SomeTerm,Model.AnotherTerm,Namespace.*"

  - Name: Preferences - include annotations - no prefix
    Rule: preference
    Input: include-annotations="*"

  - Name: Preferences - maxpagesize - ok
    Rule: preference
    Input: odata.maxpagesize=50

  - Name: Preferences - maxpagesize - no prefix
    Rule: preference
    Input: maxpagesize=50

  - Name: Preferences - maxpagesize - not zero
    Rule: maxpagesizePreference
    FailAt: 18
    Input: odata.maxpagesize=0

  - Name: Preferences - maxpagesize - not negative
    Rule: maxpagesizePreference
    FailAt: 18
    Input: odata.maxpagesize=-1

  - Name: Preferences - omit-values - defaults
    Rule: preference
    Input: omit-values=defaults

  - Name: Preferences - omit-values - nulls
    Rule: preference
    Input: omit-values=nulls

  - Name: Preferences - return minimal
    Rule: preference
    Input: return=minimal

  - Name: Preferences - return representation
    Rule: preference
    Input: return=representation

  - Name: Preferences - respond async
    Rule: preference
    Input: respond-async

  - Name: Preferences - track changes
    Rule: preference
    Input: odata.track-changes

  - Name: Preferences - track changes - no prefix
    Rule: preference
    Input: track-changes

  - Name: Preferences - wait
    Rule: preference
    Input: wait=0

  - Name: Preferences - wait with bad whitespace
    Rule: preference
    Input: wait = 0

  - Name: Schema Version - numeric
    Rule: systemQueryOption
    Input: $schemaversion=0001

  - Name: Schema Version - alphanumeric
    Rule: systemQueryOption
    Input: schemaversion=second

  - Name: Schema Version - semantic
    Rule: systemQueryOption
    Input: schemaversion=1.42.2

  - Name: Schema Version - latest
    Rule: systemQueryOption
    Input: $schemaversion=*

  - Name: ODATA-633 hex pair bug
    Rule: stringInUrl
    Input: '"b%75g"'
