forked from oasis-tcs/odata-abnf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathodata-abnf-testcases.xml
2827 lines (2811 loc) · 128 KB
/
odata-abnf-testcases.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!--
OData ABNF Test Cases Version 4.01 and 4.0
05 November 2019
Technical Committee:
OASIS Open Data Protocol (OData) TC
https://www.oasis-open.org/committees/odata
Chairs:
- Ralf Handl ([email protected]), SAP SE
- Michael Pizzo ([email protected]), Microsoft
Editors:
- Ralf Handl ([email protected]), SAP SE
- Michael Pizzo ([email protected]), Microsoft
- Martin Zurmuehl ([email protected]), SAP SE
Additional artifacts:
This test case document is one component of a Work Product which consists of:
- OData Version 4.01 Part 1: Protocol
- OData Version 4.01 Part 2: URL Conventions
- OData ABNF Construction Rules Version 4.01
- OData ABNF Test Cases Version 4.01 (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.01
- OData Common Schema Definition Language (CSDL) XML Representation Version 4.01
- OData JSON Format Version 4.01
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.01.
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.01 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/SAP/abnf-test-tool.
This tool is neither required for interpreting the test cases, nor is it
part of the OData work product.
-->
<TestSuite MaxUncoveredRules="80" xmlns="http://docs.oasis-open.org/odata/ns/testcases">
<!--
This document contains positive and negative test cases for the
OData ABNF Construction Rules Version 4.01.
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.01 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/SAP/abnf-test-tool.
This tool is neither required for interpreting the test cases, nor is it
part of the OData work product.
-->
<DisableTrace Rule="odataIdentifier" />
<DisableTrace Rule="identifierLeadingCharacter" />
<DisableTrace Rule="identifierCharacter" />
<DisableTrace Rule="ALPHA" />
<DisableTrace Rule="DIGIT" />
<DisableTrace Rule="unreserved" />
<!-- constraints needed only for rule alternatives added by data aggregation -->
<Constraint Rule="customAggregate" />
<Constraint Rule="expressionAlias" />
<!-- end of constraints for data aggregation -->
<Constraint Rule="action">
<Match>ActionName</Match>
<Match>Cluster</Match>
<Match>Discount</Match>
<Match>Rejection</Match>
</Constraint>
<Constraint Rule="actionImport">
<Match>Activation</Match>
</Constraint>
<Constraint Rule="complexAnnotationInQuery">
<Match>@Core.Messages</Match>
<Match>@Namespace.SomeTerm</Match>
</Constraint>
<Constraint Rule="complexColProperty">
<Match>Addresses</Match>
<Match>_at_Core_dot_Messages</Match>
</Constraint>
<Constraint Rule="complexColFunction">
<Match>MostPopularAddresses</Match>
</Constraint>
<Constraint Rule="complexColFunctionImport">
<Match>TheMostPopularAddresses</Match>
</Constraint>
<Constraint Rule="complexFunction">
<Match>MostPopularAddress</Match>
</Constraint>
<Constraint Rule="complexFunctionImport">
<Match>TheMostPopularAddress</Match>
</Constraint>
<Constraint Rule="complexProperty">
<Match>Address</Match>
</Constraint>
<Constraint Rule="complexTypeName">
<Match>Address</Match>
<Match>AddressWithLocation</Match>
</Constraint>
<Constraint Rule="customName">
<Match>!deltatoken</Match>
<Match>!special</Match>
<Match>find</Match>
</Constraint>
<Constraint Rule="entityAnnotationInFragment">
<Match>@Namespace.EntityTerm</Match>
</Constraint>
<Constraint Rule="entityColFunction">
<Match>AllOrders</Match>
<Match>ProductsByColor</Match>
<Match>WithIngredients</Match>
</Constraint>
<Constraint Rule="entityColFunctionImport">
<Match>AllProductsByColor</Match>
<Match>AllProductsByCategoryId</Match>
<Match>EmployeesByManager</Match>
<Match>ProductsByCategoryId</Match>
<Match>ProductsByColor</Match>
<Match>ProductsByComplex</Match>
<Match>ProductsByCustomer</Match>
<Match>ProductsOrderedBy</Match>
</Constraint>
<Constraint Rule="entityColNavigationProperty">
<Match>DirectReports</Match>
<Match>Items</Match>
<Match>Orders</Match>
<Match>Products</Match>
<Match>Sales</Match>
</Constraint>
<Constraint Rule="entityFunction">
<Match>BestProduct</Match>
<Match>MostExpensive</Match>
</Constraint>
<Constraint Rule="entityFunctionImport">
<Match>TheBestProduct</Match>
</Constraint>
<Constraint Rule="entityNavigationProperty">
<Match>Category</Match>
<Match>Continent</Match>
<Match>Country</Match>
<Match>Countries</Match>
<Match>CountrySet</Match>
<Match>Currency</Match>
<Match>Customer</Match>
<Match>Customers</Match>
<Match>Manager</Match>
<Match>Product</Match>
<Match>ProductGroup</Match>
<Match>Supplier</Match>
<Match>Time</Match>
</Constraint>
<Constraint Rule="entitySetName">
<Match>Categories</Match>
<Match>Countries</Match>
<Match>Customers</Match>
<Match>Employees</Match>
<Match>LeaveRequests</Match>
<Match>Orders</Match>
<Match>OrderItems</Match>
<Match>People</Match>
<Match>Products</Match>
<Match>Sales</Match>
<Match>SalesOrganizations</Match>
<Match>Suppliers</Match>
</Constraint>
<Constraint Rule="entityTypeName">
<Match>Customer</Match>
<Match>Employee</Match>
<Match>Manager</Match>
<Match>BestSellingProduct</Match>
<Match>PreferredSupplier</Match>
<Match>VipCustomer</Match>
</Constraint>
<Constraint Rule="enumMemberValue">
<Match>32</Match>
</Constraint>
<Constraint Rule="enumerationMember">
<Match>Solid</Match>
<Match>Yellow</Match>
</Constraint>
<Constraint Rule="enumerationTypeName">
<Match>NameKind</Match>
<Match>Pattern</Match>
</Constraint>
<Constraint Rule="keyPathLiteral">
<Match>1</Match>
<Match>2001</Match>
<Match>A1245</Match>
<Match>O'Neil</Match>
<Match>O%27Neil</Match>
<Match>Smartphone%2FTablet</Match>
</Constraint>
<Constraint Rule="keyPropertyAlias">
<Match>KeyAlias</Match>
</Constraint>
<Constraint Rule="lambdaVariableExpr">
<Match>lambda</Match>
<Match>m</Match>
</Constraint>
<Constraint Rule="namespacePart">
<Match>Core</Match>
<Match>Measures</Match>
<Match>Model</Match>
<Match>Namespace</Match>
<Match>odata</Match>
<Match>SaM</Match>
<Match>Sales</Match>
<Match>Special</Match>
</Constraint>
<Constraint Rule="parameterAlias">
<Match>@a</Match>
<Match>@bar</Match>
<Match>@c</Match>
<Match>@cat</Match>
<Match>@categoryId</Match>
<Match>@color</Match>
<Match>@expression</Match>
<Match>@foo</Match>
<Match>@i</Match>
<Match>@key</Match>
<Match>@ManagerID</Match>
<Match>@m</Match>
<Match>@p1</Match>
<Match>@ref</Match>
<Match>@title</Match>
<Match>@word</Match>
</Constraint>
<Constraint Rule="parameterName">
<Match>categoryId</Match>
<Match>color</Match>
<Match>colors</Match>
<Match>customer</Match>
<Match>Customers</Match>
<Match>complex</Match>
<Match>Ingredients</Match>
<Match>Kind</Match>
<Match>Location</Match>
<Match>ManagerID</Match>
<Match>Number</Match>
<Match>Rank</Match>
<Match>Size</Match>
<Match>Word</Match>
<Match>Word1</Match>
<Match>Word2</Match>
</Constraint>
<Constraint Rule="primitiveAnnotationInQuery">
<Match>@Measures.Currency</Match>
</Constraint>
<Constraint Rule="primitiveColAnnotationInQuery">
<Match>@Core.MayImplement</Match>
</Constraint>
<Constraint Rule="primitiveColFunction">
<Match>MostPopularNames</Match>
</Constraint>
<Constraint Rule="primitiveColFunctionImport">
<Match>TheMostPopularNames</Match>
</Constraint>
<Constraint Rule="primitiveColProperty">
<Match>EmailAddresses</Match>
<Match>Names</Match>
<Match>Sizes</Match>
</Constraint>
<Constraint Rule="primitiveFunction">
<Match>Available</Match>
<Match>MostPopularCategory</Match>
<Match>MostPopularName</Match>
<Match>PhoneticallySimilar</Match>
<Match>GeoLocation</Match>
</Constraint>
<Constraint Rule="primitiveFunctionImport">
<Match>TheMostPopularName</Match>
</Constraint>
<Constraint Rule="primitiveKeyProperty">
<Match>Code</Match>
<Match>Date</Match>
<Match>ID</Match>
<Match>ItemID</Match>
<Match>OrderID</Match>
<Match>Size</Match>
</Constraint>
<Constraint Rule="primitiveNonKeyProperty">
<Match>AccountRepresentative</Match>
<Match>Age</Match>
<Match>Amount</Match>
<Match>BirthDate</Match>
<Match>City</Match>
<Match>code</Match>
<Match>CompanyName</Match>
<Match>ContactName</Match>
<Match>Completed</Match>
<Match>Cost</Match>
<Match>CountryCode</Match>
<Match>eyeColor</Match>
<Match>FirstName</Match>
<Match>LastName</Match>
<Match>LifeTime</Match>
<Match>Line</Match>
<Match>Location</Match>
<Match>message</Match>
<Match>Month</Match>
<Match>Name</Match>
<Match>Population</Match>
<Match>Price</Match>
<Match>Quantity</Match>
<Match>Rating</Match>
<Match>ReleaseDate</Match>
<Match>Revenue</Match>
<Match>SalesArea</Match>
<Match>severity</Match>
<Match>Shipped</Match>
<Match>Spokesperson</Match>
<Match>State</Match>
<Match>Status</Match>
<Match>Street</Match>
<Match>style</Match>
<Match>SumAmount</Match>
<Match>TaxRate</Match>
<Match>Title</Match>
<Match>X</Match>
<Match>ZipCode</Match>
</Constraint>
<Constraint Rule="singletonEntity">
<Match>BestProductEverCreated</Match>
<Match>MainSupplier</Match>
<Match>SingletonEntity</Match>
</Constraint>
<Constraint Rule="streamProperty">
<Match>Thumbnail</Match>
</Constraint>
<Constraint Rule="termName">
<Match>AnotherTerm</Match>
<Match>Currency</Match>
<Match>EntityTerm</Match>
<Match>id</Match>
<Match>MayImplement</Match>
<Match>Messages</Match>
<Match>SomeTerm</Match>
<Match>type</Match>
</Constraint>
<Constraint Rule="typeDefinitionName">
<Match>MonetaryAmount</Match>
</Constraint>
<TestCase Name="Just to test the dummy start rule" Rule="dummyStartRule">
<Input>http://services.odata.org/</Input>
</TestCase>
<TestCase Name="URI with IPv4 address, path and trailing slash" Rule="odataUri">
<Input>http://127.0.0.1:8080/MyService/</Input>
</TestCase>
<TestCase Name="URI with IPv6 address, path and trailing slash" Rule="odataUri">
<Input>https://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:8080/MyService/</Input>
</TestCase>
<TestCase Name="URI with IPvFuture address, path and trailing slash" Rule="odataUri">
<Input>https://[v7.0]/MyService/</Input>
</TestCase>
<TestCase Name="URI without schema separator" Rule="odataUri" FailAt="4">
<Input>http//My.Org/</Input>
</TestCase>
<TestCase Name="Binary with X" Rule="binary" FailAt="0">
<Input>X'1a2B3c4D'</Input>
</TestCase>
<TestCase Name="Binary - empty" Rule="binary">
<Input>binary''</Input>
</TestCase>
<TestCase Name="Binary - f" Rule="binary">
<Input>binary'Zg=='</Input>
</TestCase>
<TestCase Name="Binary - f (pad character is optional)" Rule="binary">
<Input>binary'Zg'</Input>
</TestCase>
<TestCase Name="Binary - fo" Rule="binary">
<Input>binary'Zm8='</Input>
</TestCase>
<TestCase Name="Binary - fo (pad character is optional)" Rule="binary">
<Input>binary'Zm8='</Input>
</TestCase>
<TestCase Name="Binary - foo" Rule="binary">
<Input>binary'Zm9v'</Input>
</TestCase>
<TestCase Name="Binary - foob" Rule="binary">
<Input>binary'Zm9vYg=='</Input>
</TestCase>
<TestCase Name="Binary - fooba" Rule="binary">
<Input>binary'Zm9vYmE='</Input>
</TestCase>
<TestCase Name="Binary - foobar" Rule="binary">
<Input>binary'Zm9vYmFy'</Input>
</TestCase>
<TestCase Name="Boolean - true" Rule="booleanValue">
<Input>true</Input>
</TestCase>
<TestCase Name="Boolean - false" Rule="booleanValue">
<Input>false</Input>
</TestCase>
<TestCase Name="Boolean - literals are case-insensitive" Rule="booleanValue">
<Input>tRUe</Input>
</TestCase>
<TestCase Name="Date in URL or body" Rule="dateValue">
<Input>2012-09-03</Input>
</TestCase>
<TestCase Name="Date" Rule="dateValue">
<Input>2012-09-10</Input>
</TestCase>
<TestCase Name="Date" Rule="dateValue">
<Input>2012-09-20</Input>
</TestCase>
<TestCase Name="Date" Rule="dateValue">
<Input>2012-09-03</Input>
</TestCase>
<TestCase Name="Date: year zero" Rule="dateValue">
<Input>0000-01-01</Input>
</TestCase>
<TestCase Name="Date: negative" Rule="dateValue">
<Input>-10000-04-01</Input>
</TestCase>
<TestCase Name="Date: negative Infinity" Rule="dateValue" FailAt="1">
<Input>-INF</Input>
</TestCase>
<TestCase Name="Date: positive Infinity" Rule="dateValue" FailAt="0">
<Input>INF</Input>
</TestCase>
<TestCase Name="DateTimeOffset: no seconds" Rule="dateTimeOffsetValue">
<Input>2012-09-03T13:52Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: seconds" Rule="dateTimeOffsetValue">
<Input>2012-09-03T22:09:02Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: leap second" Rule="dateTimeOffsetValue">
<Input>1972-06-30T23:59:60Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: subseconds" Rule="dateTimeOffsetValue">
<Input>2012-08-31T18:19:22.1Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: year zero" Rule="dateTimeOffsetValue">
<Input>0000-01-01T00:00Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: negative" Rule="dateTimeOffsetValue">
<Input>-10000-04-01T00:00Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: Midnight this day" Rule="dateTimeOffsetValue" FailAt="12">
<Input>2011-12-31T24:00Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: Midnight this day with seconds" Rule="dateTimeOffsetValue" FailAt="12">
<Input>2011-12-31T24:00:00Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: CEST" Rule="dateTimeOffsetValue">
<Input>2012-09-03T14:53+02:00</Input>
</TestCase>
<TestCase Name="DateTimeOffset: UTC" Rule="dateTimeOffsetValue">
<Input>2012-09-03T12:53Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: 24:00" Rule="dateTimeOffsetValue" FailAt="12">
<Input>2012-09-03T24:00-03:00</Input>
</TestCase>
<TestCase Name="DateTimeOffset: negative infinitiy" Rule="dateTimeOffsetValue" FailAt="1">
<Input>-INF</Input>
</TestCase>
<TestCase Name="DateTimeOffset: positive infinitiy" Rule="dateTimeOffsetValue" FailAt="0">
<Input>INF</Input>
</TestCase>
<TestCase Name="DateTimeOffset: no percent-encoding in payloads" Rule="dateTimeOffsetValue" FailAt="13">
<Input>2012-09-03T23%3A59Z</Input>
</TestCase>
<TestCase Name="DateTimeOffset: no percent-encoding in payloads" Rule="dateTimeOffsetValue" FailAt="19">
<Input>2012-09-03T23:59+01%3A00</Input>
</TestCase>
<TestCase Name="DateTimeOffset: with percent-encoding" Rule="dateTimeOffsetValueInUrl">
<Input>2012-09-03T23%3A59+01%3A00</Input>
</TestCase>
<TestCase Name="Decimal" Rule="decimalValue">
<Input>3.14</Input>
</TestCase>
<TestCase Name="Decimal - exponential notation" Rule="decimalValue">
<Input>-1.234567e3</Input>
</TestCase>
<TestCase Name="Decimal - exponential notation" Rule="decimalValue">
<Input>1e-101</Input>
</TestCase>
<TestCase Name="Decimal - negative infinitiy" Rule="decimalValue">
<Input>-INF</Input>
</TestCase>
<TestCase Name="Decimal - positive infinitiy" Rule="decimalValue">
<Input>INF</Input>
</TestCase>
<TestCase Name="Decimal - not a number" Rule="decimalValue">
<Input>NaN</Input>
</TestCase>
<TestCase Name="Duration in body" Rule="durationValue">
<Input>P6DT23H59M59.9999S</Input>
</TestCase>
<TestCase Name="Duration in body: no years allowed" Rule="durationValue" FailAt="2">
<Input>P1Y6DT23H59M59.9999S</Input>
</TestCase>
<TestCase Name="Duration in body: no months allowed" Rule="durationValue" FailAt="2">
<Input>P1M6DT23H59M59.9999S</Input>
</TestCase>
<TestCase Name="Duration in URL" Rule="duration">
<Input>duration'P6DT23H59M59.9999S'</Input>
</TestCase>
<TestCase Name="Duration in URL without prefix" Rule="duration">
<Input>'P6DT23H59M59.9999S'</Input>
</TestCase>
<TestCase Name="Decimal: integer" Rule="decimalValue">
<Input>-2</Input>
</TestCase>
<TestCase Name="Decimal: integer" Rule="decimalValue" FailAt="4">
<Input>+42.</Input>
</TestCase>
<TestCase Name="Decimal: no digit before decimal point" Rule="decimalValue" FailAt="0">
<Input>.1</Input>
</TestCase>
<TestCase Name="Decimal in URL" Rule="decimalValue">
<Input>3.14</Input>
</TestCase>
<TestCase Name="Double" Rule="doubleValue">
<Input>3.14</Input>
</TestCase>
<TestCase Name="Double with exponent" Rule="doubleValue">
<Input>-0.314e1</Input>
</TestCase>
<TestCase Name="Double with at most one exponent" Rule="doubleValue" FailAt="8">
<Input>-0.314e1e2</Input>
</TestCase>
<TestCase Name="Negative infinity" Rule="doubleValue">
<Input>-INF</Input>
</TestCase>
<TestCase Name="Positive infinity" Rule="doubleValue">
<Input>INF</Input>
</TestCase>
<TestCase Name="Not a Number" Rule="doubleValue">
<Input>NaN</Input>
</TestCase>
<TestCase Name="Double in URL" Rule="doubleValue">
<Input>-0.314e1</Input>
</TestCase>
<TestCase Name="Single in URL" Rule="singleValue">
<Input>-0.314e1</Input>
</TestCase>
<TestCase Name="Byte" Rule="byteValue">
<Input>255</Input>
</TestCase>
<TestCase Name="SByte" Rule="sbyteValue">
<Input>-128</Input>
</TestCase>
<TestCase Name="Int16" Rule="int16Value">
<Input>+32000</Input>
</TestCase>
<TestCase Name="Int32" Rule="int32Value">
<Input>-2000000000</Input>
</TestCase>
<TestCase Name="Int64" Rule="int64Value">
<Input>1234567890123456789</Input>
</TestCase>
<TestCase Name="Null: unqualified" Rule="nullValue">
<Input>null</Input>
</TestCase>
<TestCase Name="String" Rule="string">
<Input>'ABCDEFGHIHJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&('')*+,;=:@'</Input>
</TestCase>
<TestCase Name="String" Rule="string">
<Input>'O''Neil'</Input>
</TestCase>
<TestCase Name="String" Rule="string">
<Input>%27O'%27Neil'</Input>
</TestCase>
<TestCase Name="String" Rule="string" FailAt="3">
<Input>'O'Neil'</Input>
</TestCase>
<TestCase Name="String" Rule="string" FailAt="5">
<Input>'O%27Neil'</Input>
</TestCase>
<TestCase Name="String" Rule="string">
<Input>'%26%28'</Input>
</TestCase>
<TestCase Name="primitive value in request body - enumeration member" Rule="primitiveValue">
<Input>Yellow</Input>
</TestCase>
<TestCase Name="primitive value in request body - geo point" Rule="primitiveValue">
<Input>SRID=0;Point(142.1 64.1)</Input>
</TestCase>
<TestCase Name="primitive value in request body - integer" Rule="primitiveValue">
<Input>0123456789</Input>
</TestCase>
<TestCase Name="primitive value in request body - guid" Rule="primitiveValue">
<Input>01234567-89ab-cdef-0123-456789abcdef</Input>
</TestCase>
<TestCase Name="primitive value in request body - binary" Rule="primitiveValue">
<Input>a123456789abcdefABA=</Input>
</TestCase>
<TestCase Name="primitive value in request body - binary with line breaks and spaces" Rule="primitiveValue" FailAt="8">
<Input>a1234567 89
ab
cdefABA</Input>
</TestCase>
<TestCase Name="Resource Path - Entity Set" Rule="resourcePath">
<Input>Categories</Input>
</TestCase>
<TestCase Name="Resource Path - Entity" Rule="resourcePath">
<Input>Categories(11)</Input>
</TestCase>
<TestCase Name="Resource Path - Entity" Rule="resourcePath">
<Input>Categories(ID=1)</Input>
</TestCase>
<TestCase Name="Key" Rule="string">
<Input>'Hugo''s%20Tavern'</Input>
</TestCase>
<TestCase Name="Resource Path - Entity" Rule="resourcePath">
<Input>Categories(ID=1,Size=5)</Input>
</TestCase>
<TestCase Name="Correct Guid" Rule="guidValue">
<Input>01234567-89ab-cdef-0123-456789abcdef</Input>
</TestCase>
<TestCase Name="Guid with wrong character" Rule="guidValue" FailAt="5">
<Input>01234g67-89ab-cdef-0123-456789abcdef</Input>
</TestCase>
<TestCase Name="Guid with less than 32 digits" Rule="guidValue" FailAt="23">
<Input>01234567-89ab-cdef-456789abcdef</Input>
</TestCase>
<TestCase Name="TimeOfDay" Rule="timeOfDayValue">
<Input>11:22:33</Input>
</TestCase>
<TestCase Name="TimeOfDay - percent-encoded colon" Rule="timeOfDayValueInUrl">
<Input>11%3A22%3a33</Input>
</TestCase>
<TestCase Name="TimeOfDay - no percent-encoding in payloads" Rule="timeOfDayValue" FailAt="2">
<Input>11%3A22%3a33</Input>
</TestCase>
<TestCase Name="TimeOfDay: no seconds" Rule="timeOfDayValue">
<Input>11:22</Input>
</TestCase>
<TestCase Name="TimeOfDay: fractional seconds" Rule="timeOfDayValue">
<Input>11:22:33.4444444</Input>
</TestCase>
<TestCase Name="TimeOfDay: 24:00" Rule="timeOfDayValue" FailAt="1">
<Input>24:00:00</Input>
</TestCase>
<TestCase Name="Identifier" Rule="odataIdentifier">
<Input>TheQuickBrownFoxSays42</Input>
</TestCase>
<TestCase Name="Identifier with leading underscores" Rule="odataIdentifier">
<Input>__ID</Input>
</TestCase>
<TestCase Name="Identifier: no starting digit" Rule="odataIdentifier" FailAt="0">
<Input>0time</Input>
</TestCase>
<TestCase Name="Identifier: no dots within" Rule="odataIdentifier" FailAt="2">
<Input>No.Dot</Input>
</TestCase>
<TestCase Name="Entity Set" Rule="resourcePath">
<Input>Products</Input>
</TestCase>
<!--
Test cases for example URLs in Part 1: Protocol
-->
<TestCase Name="Inline Parameter Syntax" Rule="odataUri">
<Input>http://host/service/EmployeesByManager(ManagerID=3)</Input>
</TestCase>
<TestCase Name="Inline Parameter Syntax" Rule="odataUri">
<Input>http://host/service/EmployeesByManager(ManagerID=@p1)?@p1=3</Input>
</TestCase>
<TestCase Name="Inline Parameter Syntax" Rule="odataUri">
<Input>http://host/service/EmployeesByManager?ManagerID=3</Input>
</TestCase>
<TestCase Name="Inline Parameter Syntax" Rule="odataUri">
<Input>http://host/service/EmployeesByManager?@ManagerID=3</Input>
</TestCase>
<!--
Test cases for example URLs in Part 2: URL Conventions
-->
<TestCase Name="2 URL Components - service root URL" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/</Input>
</TestCase>
<TestCase Name="2 URL Components - service root directly at server root" Rule="odataUri">
<Input>http://My.Org:80/</Input>
</TestCase>
<TestCase Name="2 URL Components - resource path" Rule="resourcePath">
<Input>Categories(1)/Products</Input>
</TestCase>
<TestCase Name="2 URL Components - resource path" Rule="resourcePath">
<Input>Categories(1)/Products</Input>
</TestCase>
<TestCase Name="2 URL Components - key with key property alias" Rule="resourcePath">
<Input>Categories(KeyAlias=1)</Input>
</TestCase>
<TestCase Name="2 URL Components - key with parameter alias - short form" Rule="odataRelativeUri">
<Input>Categories(@key)?@key=1</Input>
</TestCase>
<TestCase Name="2 URL Components - key with parameter alias - long form" Rule="odataRelativeUri">
<Input>Categories(ID=@key)?@key=1</Input>
</TestCase>
<TestCase Name="2 URL Components - query options" Rule="queryOptions">
<Input>$top=2&$orderby=Name</Input>
</TestCase>
<TestCase Name="2 URL Components - resource path and query options" Rule="odataRelativeUri">
<Input>Categories(1)/Products?$top=2&$orderby=Name</Input>
</TestCase>
<TestCase Name="2 URL Components - single quotes" Rule="odataRelativeUri">
<Input>Customers('O''Neil')</Input>
</TestCase>
<TestCase Name="2 URL Components - single quotes" Rule="odataRelativeUri">
<Input>Customers(%27O%27%27Neil%27)</Input>
</TestCase>
<TestCase Name="2 URL Components - unquoted single quotes" Rule="odataRelativeUri" FailAt="15">
<Input>Customers('O%27Neil')</Input>
</TestCase>
<TestCase Name="2 URL Components - parentheses" Rule="odataRelativeUri">
<Input>Customers%28%27O%27%27Neil%27%29</Input>
</TestCase>
<TestCase Name="2 URL Components - encoded forward slash" Rule="odataUri">
<Input>http://host/service/Categories('Smartphone%2FTablet')</Input>
</TestCase>
<TestCase Name="2 URL Components - unencoded forward slash" Rule="odataRelativeUri" FailAt="22">
<Input>Categories('Smartphone/Tablet')</Input>
</TestCase>
<TestCase Name="4.1 - Metadata URL" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$metadata</Input>
</TestCase>
<TestCase Name="4.1 - Metadata URL - CSDL JSON" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$metadata?$format=json</Input>
</TestCase>
<TestCase Name="4.1 - Metadata URL - CSDL XML" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$metadata?$format=xml</Input>
</TestCase>
<TestCase Name="4.1 - Metadata URL - allowed" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$metadata?$format=text/html</Input>
</TestCase>
<TestCase Name="4.1 - Metadata URL - allowed" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$metadata?$format=text/html&!special</Input>
</TestCase>
<TestCase Name="4.2 - Batch URL" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$batch</Input>
</TestCase>
<TestCase Name="4.2 - Batch URL - JSON batch response" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$batch?$format=json</Input>
</TestCase>
<TestCase Name="4.2 - Batch URL - multipart batch response" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$batch?$format=multipart/mixed</Input>
</TestCase>
<TestCase Name="4.2 - Batch URL - allowed" Rule="odataUri">
<Input>http://services.odata.org/OData/OData.svc/$batch?!special</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - entity set" Rule="entitySetName">
<Input>Products</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - entity set" Rule="odataRelativeUri">
<Input>Products</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - no trailing dot" Rule="odataRelativeUri" FailAt="8">
<Input>Products.('foo')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - no leading dot" Rule="odataRelativeUri" FailAt="0">
<Input>.Products('foo')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - function call" Rule="odataRelativeUri">
<Input>ProductsByCategoryId(categoryId=2)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - function call with subsequent key segment" Rule="odataRelativeUri">
<Input>ProductsByCategoryId(categoryId=2)(2)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - function call with alias" Rule="odataRelativeUri">
<Input>ProductsByCategoryId(categoryId=@cat)?@cat=2</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - function call with alias for expression" Rule="odataRelativeUri">
<Input>ProductsByCategoryId(categoryId=@cat)?@cat=Model.MostPopularCategory(Rank=2)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - function call with query parameter" Rule="odataRelativeUri">
<Input>ProductsByCategoryId(categoryId=2)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - function call with query parameter" Rule="odataRelativeUri">
<Input>ProductsByCategoryId?@categoryId=2</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - function parameter" Rule="functionParameter">
<Input>color='red'</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - top-level function call" Rule="odataRelativeUri">
<Input>ProductsByColor(color='red')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - bound function call" Rule="odataRelativeUri">
<Input>Categories(1)/Model.ProductsByColor(color='red')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - bound function call with implicit parameter aliases" Rule="odataRelativeUri">
<Input>Categories(1)/Model.ProductsByColor?@color='red'</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (short)" Rule="resourcePath">
<Input>Categories(1)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (short)" Rule="odataRelativeUri">
<Input>Customers(1)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (long)" Rule="resourcePath">
<Input>Categories(ID=1)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (string)" Rule="resourcePath">
<Input>Categories('Tablet')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (string)" Rule="resourcePath">
<Input>Categories('7''''%20Tablet')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (string)" Rule="resourcePath">
<Input>Categories%28%27Tablet%27%29</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (string)" Rule="resourcePath">
<Input>Categories('Tablet%2FSlate')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (wrong)" Rule="resourcePath" FailAt="18">
<Input>Categories('Tablet/Slate')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (string)" Rule="resourcePath">
<Input>Categories('Tablet%20%28small%29')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (string)" Rule="resourcePath">
<Input>Categories('Tablet%20(small)')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (string)" Rule="resourcePath">
<Input>Categories('Tablet%20)small(')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (timestamp)" Rule="resourcePath">
<Input>Categories(2018-02-13T23:59:59Z)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (timestamp, percent-encoded colon)" Rule="resourcePath">
<Input>Categories(2018-02-13T23%3A59%3A59Z)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (time)" Rule="resourcePath">
<Input>Categories(23:59:59)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (time, percent-encoded colon)" Rule="resourcePath">
<Input>Categories(23%3A59%3A59)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (wrong)" Rule="resourcePath" FailAt="19">
<Input>Categories(ID=wrong)</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (multi-part key)" Rule="resourcePath">
<Input>OrderItems(OrderID=1,ItemID='a')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single entity (wrong multi-part key)" Rule="resourcePath" FailAt="20">
<Input>OrderItems(OrderID=1;ItemID='a')</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - bound operation on entity set" Rule="resourcePath">
<Input>Products/Model.MostExpensive()</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - follow navigation property" Rule="resourcePath">
<Input>Products(1)/Supplier</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - follow navigation property and call function" Rule="odataRelativeUri">
<Input>Categories(1)/Products/Model.AllOrders()</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - follow navigation property and call function, then count results"
Rule="odataRelativeUri"
>
<Input>Categories(1)/Products/Model.AllOrders()/$count</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - follow navigation property and call function - no parens" Rule="odataRelativeUri">
<Input>Categories(1)/Products/Model.AllOrders</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - follow navigation property and call function - no namespace" Rule="odataRelativeUri">
<Input>Categories(1)/Products/AllOrders</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - follow navigation property and call function" Rule="odataRelativeUri">
<Input>Categories(1)/Products/Model.MostExpensive()</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - singleton entities" Rule="resourcePath">
<Input>SingletonEntity</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - single navigation property in complex type" Rule="resourcePath">
<Input>Customers(1)/Address/Country</Input>
</TestCase>
<TestCase Name="4.3 Addressing entities - collection navigation property in complex type" Rule="resourcePath">
<Input>Customers(1)/Address/Products</Input>
</TestCase>
<TestCase Name="4.3.1 Canonical URL" Rule="odataRelativeUri">
<Input>Categories(1)/Products(1)</Input>
</TestCase>
<TestCase Name="4.3.4 $entity with OData URL" Rule="odataRelativeUri">
<Input>$entity?$id=http://host/path</Input>
</TestCase>
<TestCase Name="4.3.4 $entity with URN" Rule="odataRelativeUri">
<Input>$entity?$id=urn:some:id</Input>
</TestCase>
<TestCase Name="4.3.4 $entity with URN, id without $ prefix" Rule="odataRelativeUri">
<Input>$entity?id=urn:some:id</Input>
</TestCase>
<TestCase 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</Input>
</TestCase>
<TestCase 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</Input>
</TestCase>
<TestCase Name="4.3.4 $entity without $id fails" Rule="odataRelativeUri" FailAt="20">
<Input>$entity?$format=json</Input>
</TestCase>
<TestCase Name="4.3.6 Key-as-Segment - single entity (numeric single-part key)" Rule="odataRelativeUri">
<Input>Customers/1</Input>
</TestCase>
<TestCase Name="4.3.6 Key-as-Segment - single entity (string single-part key)" Rule="resourcePath">
<Input>Employees/A1245</Input>
</TestCase>
<TestCase Name="4.3.6 Key-as-Segment - single entity (string single-part key)" Rule="resourcePath">
<Input>People/O'Neil</Input>
</TestCase>
<TestCase Name="4.3.6 Key-as-Segment - single entity (string single-part key)" Rule="resourcePath">
<Input>People/O%27Neil</Input>
</TestCase>
<TestCase Name="4.3.6 Key-as-Segment - single entity (string single-part key)" Rule="resourcePath">
<Input>Categories/Smartphone%2FTablet</Input>
</TestCase>
<TestCase Name="4.3.6 Key-as-Segment - single entity (multi-part key)" Rule="resourcePath">
<Input>OrderItems/2001/1</Input>
</TestCase>
<TestCase Name="4.3.6 Key-as-Segment - navigation (segment)" Rule="resourcePath">
<Input>Orders/1/Items</Input>
</TestCase>
<TestCase Name="4.3.6 Key-as-Segment - navigation (segment)" Rule="resourcePath">
<Input>Orders/1/Items/1</Input>
</TestCase>
<TestCase Name="4.4 Addressing Links between Entities" Rule="odataRelativeUri">
<Input>Categories(1)/Products/$ref</Input>
</TestCase>
<TestCase Name="4.4 Addressing Links between Entities" Rule="odataRelativeUri">
<Input>Categories(1)/Products/$ref?$id=Products(0)</Input>
</TestCase>
<TestCase Name="4.4 Addressing Links between Entities" Rule="odataRelativeUri">
<Input>Products(1)/Category/$ref</Input>
</TestCase>
<TestCase Name="4.4 Addressing Links between Entities - count" Rule="odataRelativeUri" FailAt="27">
<Input>Categories(1)/Products/$ref/$count</Input>
</TestCase>
<TestCase Name="4.4 Addressing Links between Entities" Rule="odataRelativeUri">
<Input>Categories(1)/Products(2)/$ref</Input>
</TestCase>
<TestCase Name="4.4 Addressing Links between Entities" Rule="odataRelativeUri" FailAt="30">
<Input>Categories(1)/Products(2)/$ref/$count</Input>
</TestCase>
<TestCase Name="4.4 edge case: entity set as references" Rule="odataRelativeUri">
<Input>Categories/$ref</Input>
</TestCase>
<TestCase Name="4.4 edge case: top-level entity as reference" Rule="odataRelativeUri">
<Input>Categories(1)/$ref</Input>
</TestCase>
<TestCase Name="4.5.1 Call unbound action via action import" Rule="odataRelativeUri">
<Input>Activation</Input>
</TestCase>
<TestCase Name="4.5.1 Call bound action" Rule="odataRelativeUri">
<Input>LeaveRequests(4)/Model.Rejection</Input>
</TestCase>
<TestCase Name="4.5.1 Call action at service root" Rule="odataRelativeUri" FailAt="5">
<Input>Model.Rejection</Input>
</TestCase>
<TestCase Name="4.5.2 Call function import" Rule="odataRelativeUri">
<Input>TheBestProduct()</Input>
</TestCase>
<TestCase Name="4.5.2 Call function import - no parentheses" Rule="odataRelativeUri">
<Input>TheBestProduct</Input>
</TestCase>
<TestCase Name="4.5.2 Call function import - inline parameter" Rule="odataRelativeUri">
<Input>TheBestProduct(Size=3)</Input>
</TestCase>
<TestCase Name="4.5.2 Call function import - only at service root" Rule="odataRelativeUri" FailAt="27">
<Input>Categories/TheBestProduct()</Input>
</TestCase>
<TestCase Name="4.5.2 Call complex function import" Rule="odataRelativeUri">
<Input>TheMostPopularAddress()</Input>
</TestCase>
<TestCase Name="4.5.2 Call complex collection function import" Rule="odataRelativeUri">
<Input>TheMostPopularAddresses()</Input>
</TestCase>
<TestCase Name="4.5.2 Call primitive function import" Rule="odataRelativeUri">
<Input>TheMostPopularName()</Input>
</TestCase>
<TestCase Name="4.5.2 Call primitive function import" Rule="odataRelativeUri">
<Input>TheMostPopularName()/$value</Input>
</TestCase>
<TestCase Name="4.5.2 Call primitive collection function import" Rule="odataRelativeUri">
<Input>TheMostPopularNames()</Input>
</TestCase>
<TestCase Name="4.5.2 Call bound complex function" Rule="odataRelativeUri">
<Input>Customers/Model.MostPopularAddress()</Input>
</TestCase>
<TestCase Name="4.5.2 Call bound complex collection function" Rule="odataRelativeUri">