Ejemplo n.º 1
0
        public void IndexOf_Null()
        {
            for (int i = 0; i < ImplicitInt; i++)
            {
                deq.Add(5);
            }
            deq.Insert(8, null);

            Assert.AreEqual(8, deq.IndexOf(null));
        }
Ejemplo n.º 2
0
 public static int IndexOf(object obj, object entry)
 {
     if (obj is IList)
     {
         IList a = (IList)obj;
         return(a.IndexOf(entry));
     }
     else
     {
         IDeque a = (IDeque)obj;
         return(a.IndexOf(entry));
     }
 }
Ejemplo n.º 3
0
        public static int IndexOf(object obj, object entry, int startIndex)
        {
            if (obj is IList)
            {
                IList a = (IList)obj;
                for (int i = startIndex; i < a.Count; ++i)
                {
                    if (a[i].Equals(entry))
                    {
                        return(i);
                    }
                }
            }
            else
            {
                IDeque a = (IDeque)obj;
                return(a.IndexOf(entry, startIndex));
            }

            return(-1);
        }
Ejemplo n.º 4
0
 public void IndexOf()
 {
     AddToBoth();
     Assert.AreEqual(fake.IndexOf(0), deq.IndexOf(0));
     Assert.AreEqual(fake.IndexOf(implicitLength - 3), deq.IndexOf(implicitLength - 3));
 }