File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -339,22 +339,19 @@ public void ExceptionDecoded()
339
339
Assert . AreEqual ( TestExceptionMessage , error . Message ) ;
340
340
}
341
341
342
- [ Test ]
342
+ [ Test ( Description = "Tests encoding of an object that explicitly implements an interface." ) ]
343
343
public void ExplicitObjectInterfaceEncoded ( )
344
344
{
345
345
var obj = new ExplicitInterfaceObject ( ) ;
346
-
347
- // explicitly pass an interface (but not a generic type argument) to simulate a scenario where the type is not know at build time
348
- // var encoder = new InterfaceEncoder(typeof(IObjectInterface));
349
- // PyObjectConversions.RegisterEncoder(encoder);
350
-
351
346
using var scope = Py . CreateScope ( ) ;
352
347
scope . Exec ( @"
353
348
def call(obj):
354
349
return dir(obj)
355
350
" ) ;
356
351
var callFunc = scope . Get ( "call" ) ;
357
- var members = callFunc . Invoke ( obj . ToPythonAs ( typeof ( IObjectInterface ) ) ) . As < string [ ] > ( ) ;
352
+ // explicitly pass an interface (but not a generic type argument) to simulate a scenario where the type is not know at build time
353
+ var callArg = obj . ToPythonAs ( typeof ( IObjectInterface ) ) ;
354
+ var members = callFunc . Invoke ( callArg ) . As < string [ ] > ( ) ;
358
355
CollectionAssert . Contains ( members , nameof ( IObjectInterface . MemberFromInterface ) ) ;
359
356
CollectionAssert . DoesNotContain ( members , nameof ( ExplicitInterfaceObject . MemberFromObject ) ) ;
360
357
}
You can’t perform that action at this time.
0 commit comments