@@ -202,4 +202,41 @@ public static void ContractDescription_GetContract()
202
202
Assert . Equal ( typeof ( IDescriptionTestsService ) . Name , contractDescription . ContractType . Name ) ;
203
203
Assert . Equal ( "http://tempuri.org/" , contractDescription . Namespace ) ;
204
204
}
205
+
206
+ [ WcfFact ]
207
+ public static void OperationDescription_BeginEndSyncMethod_Property ( )
208
+ {
209
+ ContractDescription contractDescription = ContractDescription . GetContract ( typeof ( IDescriptionTestsServiceBeginEndGenerated ) ) ;
210
+ Assert . Equal ( 2 , contractDescription . Operations . Count ) ;
211
+ foreach ( OperationDescription operation in contractDescription . Operations )
212
+ {
213
+ Assert . NotNull ( operation . BeginMethod ) ;
214
+ Assert . NotNull ( operation . EndMethod ) ;
215
+ if ( operation . Name . Equals ( "Echo" ) )
216
+ {
217
+ Assert . Equal ( typeof ( IDescriptionTestsServiceBeginEndGenerated ) . GetMethod ( nameof ( IDescriptionTestsServiceBeginEndGenerated . BeginEcho ) ) , operation . BeginMethod ) ;
218
+ Assert . Equal ( typeof ( IDescriptionTestsServiceBeginEndGenerated ) . GetMethod ( nameof ( IDescriptionTestsServiceBeginEndGenerated . EndEcho ) ) , operation . EndMethod ) ;
219
+ }
220
+ else
221
+ {
222
+ Assert . Equal ( typeof ( IDescriptionTestsServiceBeginEndGenerated ) . GetMethod ( nameof ( IDescriptionTestsServiceBeginEndGenerated . BeginMessageRequestReply ) ) , operation . BeginMethod ) ;
223
+ Assert . Equal ( typeof ( IDescriptionTestsServiceBeginEndGenerated ) . GetMethod ( nameof ( IDescriptionTestsServiceBeginEndGenerated . EndMessageRequestReply ) ) , operation . EndMethod ) ;
224
+ }
225
+ }
226
+
227
+ contractDescription = ContractDescription . GetContract ( typeof ( IDescriptionTestsService ) ) ;
228
+ Assert . Equal ( 2 , contractDescription . Operations . Count ) ;
229
+ foreach ( OperationDescription operation in contractDescription . Operations )
230
+ {
231
+ Assert . NotNull ( operation . SyncMethod ) ;
232
+ if ( operation . Name . Equals ( "Echo" ) )
233
+ {
234
+ Assert . Equal ( typeof ( IDescriptionTestsService ) . GetMethod ( nameof ( IDescriptionTestsService . Echo ) ) , operation . SyncMethod ) ;
235
+ }
236
+ else
237
+ {
238
+ Assert . Equal ( typeof ( IDescriptionTestsService ) . GetMethod ( nameof ( IDescriptionTestsService . MessageRequestReply ) ) , operation . SyncMethod ) ;
239
+ }
240
+ }
241
+ }
205
242
}
0 commit comments