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")); }
/// <summary> /// Constructor /// Note: no validation of input is performed in the constructor. Call Validate after /// the constructor and when changing values. /// </summary> /// <param name="grids">list of two or four grid squares</param> public VUCC_Grids(string grids) { string[] gs = grids.Split(','); string grds = string.Empty; char[] trimChars = new char[1]; trimChars[0] = ' '; foreach(string grid in gs) { string gr = grid.Trim(trimChars); grds += gr + ","; } grds = grds.Substring(0, grds.Length - 1); gridSquares = new DelimitedList(',', grds); }
/// <summary> /// Constructor /// Note: no validation of input is performed in the constructor. Call Validate after /// the constructor and when changing values. /// </summary> /// <param name="cnties">list of two counties separated by ':'</param> public Usaca_Counties(string cnties) { counties = new DelimitedList(':', cnties); }
public void TestIsInList() { DelimitedList cdl = new DelimitedList(',', "item1,item2,item3,item4"); Assert.IsTrue(cdl.IsInList("item1")); Assert.IsTrue(cdl.IsInList("item4")); }
public void TestCount0() { DelimitedList cdl = new DelimitedList(',', string.Empty); Assert.AreEqual(0, cdl.Count); }
public void TestCount() { DelimitedList cdl = new DelimitedList(',', "item1,item2,item3,item4"); Assert.AreEqual(4, cdl.Count); }
public void TestToStringEmpty() { DelimitedList cdl = new DelimitedList(',', string.Empty); Assert.AreEqual(string.Empty, cdl.ToString()); }
public void TestToString() { DelimitedList cdl = new DelimitedList(',', "item1,item2,item3"); Assert.AreEqual("item1,item2,item3", cdl.ToString()); }
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")); }
/// <summary> /// Constructor /// Note: no validation of input is performed in the constructor. Call Validate after /// the constructor and when changing values. /// </summary> /// <param name="separator">list delimiter</param> /// <param name="list">delimited list</param> /// <param name="enumeration">name of enumeration in AdifEnumerations</param> /// <param name="aEnums">AdifEnumerations object containing the enumeration</param> public DelimitedListEnumeration(char separator, string list, string enumeration, AdifEnumerations aEnums) : base(enumeration, aEnums) { delimList = new DelimitedList(separator, list); }