public void IndexOf( [Values(10, 20, 30, 40)] int value, [Values(0, 1, 2, -1)] int expectedIndex) { int index = set.IndexOf(value); Assert.AreEqual(expectedIndex, index); }
public void IndexOfTest() { var set = new IndexedSet <string>(); Assert.That(set.IndexOf(null), Is.EqualTo(-1)); Assert.That(set.IndexOf("A"), Is.EqualTo(-1)); set.Add("A"); Assert.Zero(set.IndexOf("A")); set[0] = "B"; Assert.Zero(set.IndexOf("B")); }
private void IndexedSetIndexOf() { int index; for (int i = 0; i < count; i++) { index = indexedSet.IndexOf(data[i]); } }
public int GetElementIndexByName(string name) { return(m_roleNameSet.IndexOf(name)); }