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);
        }
Exemple #2
0
        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]);
            }
        }
Exemple #4
0
 public int GetElementIndexByName(string name)
 {
     return(m_roleNameSet.IndexOf(name));
 }