public void TestDuplicateEntriesRemoved() { DelimitedList cdl = new DelimitedList(',', "item1,item2,item3,item2,item4"); Assert.AreEqual(4, cdl.Count); Assert.IsTrue(cdl.IsInList("item1")); Assert.IsTrue(cdl.IsInList("item2")); Assert.IsTrue(cdl.IsInList("item3")); Assert.IsTrue(cdl.IsInList("item4")); }
public void TestGetItems() { DelimitedList cdl = new DelimitedList(':', "item2:item4:item3:item1"); HashSet<string> items = cdl.Items; Assert.AreEqual(4, items.Count); Assert.IsTrue(cdl.IsInList("item1")); Assert.IsTrue(cdl.IsInList("item2")); Assert.IsTrue(cdl.IsInList("item3")); Assert.IsTrue(cdl.IsInList("item4")); }
public void TestIsInList() { DelimitedList cdl = new DelimitedList(',', "item1,item2,item3,item4"); Assert.IsTrue(cdl.IsInList("item1")); Assert.IsTrue(cdl.IsInList("item4")); }
public void TestIsInListWhiteSpace() { DelimitedList cdl = new DelimitedList(':', "item1 : item2: item3:item4 "); Assert.IsTrue(cdl.IsInList("item1")); Assert.IsTrue(cdl.IsInList("item2")); Assert.IsTrue(cdl.IsInList("item3")); Assert.IsTrue(cdl.IsInList("item4")); }
public void TestIsInListNotInList() { DelimitedList cdl = new DelimitedList(',', "item1,item2,item3,item4"); Assert.IsFalse(cdl.IsInList("item6")); }