public void SetItemTest() { IWDT iwdt = new IWDT(); iwdt.SetItem(HT(1, 1), 3); Assert.AreEqual(3, iwdt.GetItem(HT(1, 2))); iwdt.SetItem(HT(1, 1), 7); Assert.AreEqual(7, iwdt.GetItem(HT(1, 2))); iwdt.Keys[Tuple.Create(1, 1)].IsGarbage = true; iwdt.SetItem(HT(1, 3), 13); Assert.AreEqual(13, iwdt.GetItem(HT(1, 2))); }
public void SetItemTest() { IWDT iwdt = new IWDT(); iwdt.SetItem(HT(1, 1), Tuple.Create(3, 1)); Assert.AreEqual(Tuple.Create(3, 1), iwdt.GetItem(HT(1, 2))); iwdt.SetItem(HT(1, 1), Tuple.Create(7, 1)); Assert.AreEqual(Tuple.Create(7, 1), iwdt.GetItem(HT(1, 2))); iwdt.Keys[Tuple.Create(1, 1)].IsGarbage = true; iwdt.SetItem(HT(1, 3), Tuple.Create(13, 1)); Assert.AreEqual(Tuple.Create(13, 1), iwdt.GetItem(HT(1, 2))); iwdt.Values[Tuple.Create(13, 1)].IsGarbage = true; iwdt.SetItem(HT(1, 3), Tuple.Create(13, 3)); Assert.AreEqual(Tuple.Create(13, 3), iwdt.GetItem(HT(1, 2))); }