def test_strongly_typed_events():
 def f():
  global called
  called = True
 global called
 called = False
 ev = IronPythonTest.Events()
 ev.InstanceTest += IronPythonTest.EventTestDelegate(f)
 ev.CallInstance()
 AreEqual(called, True)
 called = False
 ev.InstanceTest -= IronPythonTest.EventTestDelegate(f)
 ev.CallInstance()
 AreEqual(called, False)

def test_strongly_typed_events ( ) : def f ( ) : global called called = True global called called = False ev = IronPythonTest . Events ( ) ev . InstanceTest += IronPythonTest . EventTestDelegate ( f ) ev . CallInstance ( ) AreEqual ( called , True ) called = False ev . InstanceTest -= IronPythonTest . EventTestDelegate ( f ) ev . CallInstance ( ) AreEqual ( called , False )
verify recreating a strongly typed delegate doesnt prevent us from removing the event .