@@ -128,48 +128,49 @@ private void AssertVersion3( ApiDescriptionGroup group )
128128 {
129129 const string GroupName = "v3" ;
130130 var items = group . Items . OrderBy ( i => i . RelativePath ) . ThenBy ( i => i . HttpMethod ) . ToArray ( ) ;
131+ var expected = new [ ]
132+ {
133+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/GetSalesTaxRate(PostalCode={postalCode})" } ,
134+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Orders" } ,
135+ new { HttpMethod = "POST" , GroupName , RelativePath = "api/Orders" } ,
136+ new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Orders/{key}" } ,
137+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Orders/{key}" } ,
138+ new { HttpMethod = "PATCH" , GroupName , RelativePath = "api/Orders/{key}" } ,
139+ new { HttpMethod = "POST" , GroupName , RelativePath = "api/Orders/{key}/Rate" } ,
140+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Orders/$count" } ,
141+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Orders/MostExpensive" } ,
142+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/People" } ,
143+ new { HttpMethod = "POST" , GroupName , RelativePath = "api/People" } ,
144+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/People/{key}" } ,
145+ new { HttpMethod = "POST" , GroupName , RelativePath = "api/People/{key}/Promote" } ,
146+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/People/$count" } ,
147+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/People/NewHires(Since={since})" } ,
148+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products" } ,
149+ new { HttpMethod = "POST" , GroupName , RelativePath = "api/Products" } ,
150+ new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Products/{key}" } ,
151+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products/{key}" } ,
152+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products/$count" } ,
153+ new { HttpMethod = "PATCH" , GroupName , RelativePath = "api/Products/{key}" } ,
154+ new { HttpMethod = "PUT" , GroupName , RelativePath = "api/Products/{key}" } ,
155+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products/{key}/Supplier" } ,
156+ new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Products/{key}/supplier/{relatedKey}/$ref" } ,
157+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products/{key}/supplier/$ref" } ,
158+ new { HttpMethod = "PUT" , GroupName , RelativePath = "api/Products/{key}/supplier/$ref" } ,
159+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Suppliers" } ,
160+ new { HttpMethod = "POST" , GroupName , RelativePath = "api/Suppliers" } ,
161+ new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Suppliers/{key}" } ,
162+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Suppliers/{key}" } ,
163+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Suppliers/$count" } ,
164+ new { HttpMethod = "PATCH" , GroupName , RelativePath = "api/Suppliers/{key}" } ,
165+ new { HttpMethod = "PUT" , GroupName , RelativePath = "api/Suppliers/{key}" } ,
166+ new { HttpMethod = "GET" , GroupName , RelativePath = "api/Suppliers/{key}/Products" } ,
167+ new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Suppliers/{key}/products/{relatedKey}/$ref" } ,
168+ new { HttpMethod = "PUT" , GroupName , RelativePath = "api/Suppliers/{key}/products/$ref" } ,
169+ } ;
131170
132171 PrintGroup ( items ) ;
133172 group . GroupName . Should ( ) . Be ( GroupName ) ;
134- items . Should ( ) . BeEquivalentTo (
135- new [ ]
136- {
137- new { HttpMethod = "GET" , GroupName , RelativePath = "api/GetSalesTaxRate(PostalCode={postalCode})" } ,
138- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Orders" } ,
139- new { HttpMethod = "POST" , GroupName , RelativePath = "api/Orders" } ,
140- new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Orders/{key}" } ,
141- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Orders/{key}" } ,
142- new { HttpMethod = "PATCH" , GroupName , RelativePath = "api/Orders/{key}" } ,
143- new { HttpMethod = "POST" , GroupName , RelativePath = "api/Orders/{key}/Rate" } ,
144- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Orders/$count" } ,
145- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Orders/MostExpensive" } ,
146- new { HttpMethod = "GET" , GroupName , RelativePath = "api/People" } ,
147- new { HttpMethod = "POST" , GroupName , RelativePath = "api/People" } ,
148- new { HttpMethod = "GET" , GroupName , RelativePath = "api/People/{key}" } ,
149- new { HttpMethod = "POST" , GroupName , RelativePath = "api/People/{key}/Promote" } ,
150- new { HttpMethod = "GET" , GroupName , RelativePath = "api/People/$count" } ,
151- new { HttpMethod = "GET" , GroupName , RelativePath = "api/People/NewHires(Since={since})" } ,
152- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products" } ,
153- new { HttpMethod = "POST" , GroupName , RelativePath = "api/Products" } ,
154- new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Products/{key}" } ,
155- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products/{key}" } ,
156- new { HttpMethod = "PATCH" , GroupName , RelativePath = "api/Products/{key}" } ,
157- new { HttpMethod = "PUT" , GroupName , RelativePath = "api/Products/{key}" } ,
158- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products/{key}/Supplier" } ,
159- new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Products/{key}/supplier/{relatedKey}/$ref" } ,
160- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Products/{key}/supplier/$ref" } ,
161- new { HttpMethod = "PUT" , GroupName , RelativePath = "api/Products/{key}/supplier/$ref" } ,
162- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Suppliers" } ,
163- new { HttpMethod = "POST" , GroupName , RelativePath = "api/Suppliers" } ,
164- new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Suppliers/{key}" } ,
165- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Suppliers/{key}" } ,
166- new { HttpMethod = "PATCH" , GroupName , RelativePath = "api/Suppliers/{key}" } ,
167- new { HttpMethod = "PUT" , GroupName , RelativePath = "api/Suppliers/{key}" } ,
168- new { HttpMethod = "GET" , GroupName , RelativePath = "api/Suppliers/{key}/Products" } ,
169- new { HttpMethod = "DELETE" , GroupName , RelativePath = "api/Suppliers/{key}/products/{relatedKey}/$ref" } ,
170- new { HttpMethod = "PUT" , GroupName , RelativePath = "api/Suppliers/{key}/products/$ref" } ,
171- } ,
172- options => options . ExcludingMissingMembers ( ) ) ;
173+ items . Should ( ) . BeEquivalentTo ( expected , options => options . ExcludingMissingMembers ( ) ) ;
173174 }
174175
175176 private void PrintGroup ( IReadOnlyList < ApiDescription > items )
0 commit comments