public void IndexOf__An_Array_Can_Get_The_Index_Of_An_Item() { var animals = new IAnimal[] { _dog, _cat, _fish }; Assert.IsTrue(animals.IndexOf(_fish) == animals.Length - 1); }
public void InsertAfter__An_Array_Can_Insert_An_Item_After() { var animals = new IAnimal[] { _dog, _cat }; animals.InsertAfter(ref animals, _fish, animals.Length - 1); Assert.IsTrue(animals.IndexOf(_fish) == animals.Length - 1); }
public void InsertBefore__An_Array_Can_Insert_An_Item_Before() { var animals = new IAnimal[] { _cat, _fish }; animals.InsertBefore(ref animals, _dog, 0); Assert.IsTrue(animals.IndexOf(_dog) == 0); }
public void Reverse__An_Array_Can_Reverse_Itself() { var animals = new IAnimal[] { _dog, _cat, _fish }; animals.Reverse(ref animals); Assert.IsTrue(animals.IndexOf(_fish) == 0 && animals.IndexOf(_dog) == animals.Length - 1); }