def test_combine():
 global log
 def f(sender, args):
  global log
  log += 'f'
 def g(sender, args):
  global log
  log += 'g'
 fe = System.EventHandler(f)
 ge = System.EventHandler(g)
 fege = fe
 fege += ge
 log = ''
 fege(None, None)
 AreEqual(log, 'fg')
 log = ''
 fe(None, None)
 AreEqual(log, 'f')
 log = ''
 ge(None, None)
 AreEqual(log, 'g')
 fege -= ge
 log = ''
 fege(None, None)
 AreEqual(log, 'f')

def test_combine ( ) : global log def f ( sender , args ) : global log log += 'f' def g ( sender , args ) : global log log += 'g' fe = System . EventHandler ( f ) ge = System . EventHandler ( g ) fege = fe fege += ge log = '' fege ( None , None ) AreEqual ( log , 'fg' ) log = '' fe ( None , None ) AreEqual ( log , 'f' ) log = '' ge ( None , None ) AreEqual ( log , 'g' ) fege -= ge log = '' fege ( None , None ) AreEqual ( log , 'f' )
in-place addition on delegates maps to delegate .