File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,14 +13,23 @@ public class Bug_309
1313 [ TestMethod ]
1414 public void SetField91 ( )
1515 {
16- var context = new Context ( ) ;
16+ var globalContext = new GlobalContext ( ) ;
17+ try
18+ {
19+ globalContext . ActivateInCurrentThread ( ) ;
20+ var context = new Context ( ) ;
1721
18- context . GlobalContext . IndexersSupport = IndexersSupport . ForceEnable ;
19- _ = context . GlobalContext . GetConstructor ( typeof ( Dictionary < string , string > ) ) ;
20- context . GlobalContext . IndexersSupport = IndexersSupport . WithAttributeOnly ;
22+ context . GlobalContext . IndexersSupport = IndexersSupport . ForceEnable ;
23+ _ = context . GlobalContext . GetConstructor ( typeof ( Dictionary < string , string > ) ) ;
24+ context . GlobalContext . IndexersSupport = IndexersSupport . WithAttributeOnly ;
2125
22- context . Add ( "test" , new Dictionary < string , string > { [ "myKey" ] = "myValue" } ) ;
26+ context . Add ( "test" , new Dictionary < string , string > { [ "myKey" ] = "myValue" } ) ;
2327
24- Assert . AreEqual ( context . Eval ( "test.myKey" ) . ToString ( ) , "myValue" ) ;
28+ Assert . AreEqual ( "myValue" , context . Eval ( "test.myKey" ) . ToString ( ) ) ;
29+ }
30+ finally
31+ {
32+ globalContext . Deactivate ( ) ;
33+ }
2534 }
2635}
You can’t perform that action at this time.
0 commit comments