🌐 AI搜索 & 代理 主页
Skip to content
Prev Previous commit
Next Next commit
added a few tests for collection mixins
  • Loading branch information
lostmsu committed Sep 22, 2021
commit b77b7ceb74d9e972621d637420a0a2195b36ed49
16 changes: 16 additions & 0 deletions tests/test_collection_mixins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import System.Collections.Generic as C

def test_contains():
l = C.List[int]()
l.Add(42)
assert 42 in l
assert 43 not in l

def test_dict_items():
d = C.Dictionary[int, str]()
d[42] = "a"
items = d.items()
assert len(items) == 1
k,v = items[0]
assert k == 42
assert v == "a"