def test_ArrayList(self): import clr ArrayList = clr.load_cli_class(self.mscorlib, 'System.Collections', 'ArrayList') obj = ArrayList() obj.Add(42) obj.Add(43) total = obj.get_Item(0) + obj.get_Item(1) assert total == 42+43
def test_ArrayList(self): import clr ArrayList = clr.load_cli_class(self.mscorlib, 'System.Collections', 'ArrayList') obj = ArrayList() obj.Add(42) obj.Add(43) total = obj.get_Item(0) + obj.get_Item(1) assert total == 42 + 43
def test_float_conversion(self): import clr ArrayList = clr.load_cli_class(self.mscorlib, 'System.Collections', 'ArrayList') obj = ArrayList() obj.Add(42.0) item = obj.get_Item(0) assert isinstance(item, float)
def test_unboundmethod(self): import clr ArrayList = clr.load_cli_class(self.mscorlib, 'System.Collections', 'ArrayList') obj = ArrayList() ArrayList.Add(obj, 42) assert obj.get_Item(0) == 42
def test_bool_conversion(self): import clr ArrayList = clr.load_cli_class(self.mscorlib, 'System.Collections', 'ArrayList') obj = ArrayList() obj.Add(True) obj.Add(False) t = obj.get_Item(0) f = obj.get_Item(1) assert t and isinstance(t, bool) assert not f and isinstance(f, bool) obj.Add(42) assert obj.Contains(42)