public void TagPoolResetTagStateTest() { TagPool.ClearTagPool(); string epc = "300833B2DDD906C001010101"; TagInfo ti01 = new TagInfo(epc, "01"); ti01.port = common_port_9601; TagPool.AddTag(ti01); TagPool.AddTag(ti01); TagInfo tiTemp = TagPool.GetSpecifiedTag(epc); Assert.IsTrue(TagPool.GetMaxReadCountTag(tiTemp) == 2); TagPool.UpdateTagInfo(tiTemp, ti01); Assert.IsTrue(TagPool.GetMaxReadCountTag(tiTemp) == 3); TagPool.ResetReadCountDefault(tiTemp); TagPool.UpdateTagInfo(tiTemp, null); Assert.IsTrue(TagPool.GetMaxReadCountTag(tiTemp) == 0); }
public void ListReferenceTest() { TagPool.ClearTagPool(); List <TagInfo> listSrc = new List <TagInfo> { new TagInfo("111", "01"), new TagInfo("222", "01") }; TagPool.AddTagRange(listSrc); Assert.IsTrue(TagPool.GetMaxReadCountTag(listSrc[0]) == 1); List <TagInfo> listDest = new List <TagInfo>(listSrc); Assert.IsTrue(TagPool.GetMaxReadCountTag(listSrc[0]) == 1); //listSrc[0].ReadCount++; Assert.IsTrue(TagPool.GetMaxReadCountTag(listSrc[0]) == 1); listDest = listSrc.GetRange(0, listSrc.Count - 1); Assert.IsTrue(listDest.Count == 1); listDest = listDest.GetRange(0, listDest.Count - 1); Assert.IsTrue(listDest.Count == 0); }