public void TextListTest() { var textList = new TextList(); Assert.AreEqual(0, textList.Count); var i = textList.Add("Sample"); Assert.AreEqual(0, i); Assert.AreEqual(0, textList.IndexOf("Sample")); Assert.AreEqual(-1, textList.IndexOf("SAMPLE")); Assert.AreEqual(-1, textList.IndexOf("Junk")); Assert.AreEqual(1, textList.Count); }
public string Attribute(string fieldName) { var i = _fields.IndexOf(fieldName); return(i == -1 ? "" : _values[i]); }