protected void testLockList() { LockList<string> m_list = new LockList<string>("TestLockList", 4); m_list.Add("aaaaa"); m_list.Add("bbbbb"); m_list.Add("ccccc"); m_list.RemoveAt(1); }
public void ContainsFalseWorksForList() { var list = new LockList <int>(); list.Add(150); list.Add(42); list.Add(978); list.Contains(420).Should().BeFalse(); }
public void ListIndexer() { var list = new LockList <int>(); list.Add(150); list.Add(42); list.Add(978); list[1].Should().Be(42); }
public void ListIndexOfTest() { var list = new LockList <int>(); list.Add(150); list.Add(42); list.Add(978); list.IndexOf(42).Should().Be(1); }
protected void testLockList() { LockList <string> m_list = new LockList <string>("TestLockList", 4); m_list.Add("aaaaa"); m_list.Add("bbbbb"); m_list.Add("ccccc"); m_list.RemoveAt(1); }
public void ClearRemovedAllItems() { var list = new LockList <int>(); list.Add(150); list.Add(42); list.Add(978); list.Clear(); list.Should().NotBeNull(); list.Count.Should().Be(0); }
public void AddMultileItemsToList() { var list = new LockList <int>(); list.Add(150); list.Add(7); list.Add(978); list.Add(35); list.Add(42); list.Should().NotBeNull(); list.Count.Should().Be(5); }
public void RemoveWorksForList() { var list = new LockList <int>(); list.Add(150); list.Add(7); list.Add(978); list.Add(35); list.Add(42); list.Remove(978).Should().BeTrue(); list.Count.Should().Be(4); }
public void InsertWorks() { var list = new LockList <int>(); list.Add(150); list.Add(42); list.Add(978); list.Insert(1, 99); list.Count.Should().Be(4); list[1].Should().Be(99); list[2].Should().Be(42); }
public void CopyToWorks() { var list = new LockList <int>(); list.Add(150); list.Add(42); list.Add(978); var list2 = new int[3]; list.CopyTo(list2, 0); list2.Length.Should().Be(3); list2[0].Should().Be(150); list2[1].Should().Be(42); list2[2].Should().Be(978); }
public void AddSingleItemToList() { var list = new LockList <int>(); list.Add(150); list.Should().NotBeNull(); list.Count.Should().Be(1); }
/// <summary> /// (Cross-Game compatible) Return a duplicate of this /// </summary> /// <typeparam name="T"></typeparam> /// <param name="list"></param> /// <returns></returns> public static LockList <T> Duplicate <T>(this LockList <T> list) { LockList <T> newList = new LockList <T>(); for (int i = 0; i < list.Count; i++) { newList.Add(list[i]); } return(newList); }
/// <summary> /// Not Tested /// </summary> public static LockList <T> ToLockList <T>(this List <T> list) { LockList <T> lockList = new LockList <T>(); foreach (T item in list) { lockList.Add(item); } return(lockList); }
/// <summary> /// Not Tested /// </summary> public static LockList <T> ToLockList <T>(this Il2CppReferenceArray <T> referenceArray) where T : Il2CppSystem.Object { LockList <T> lockList = new LockList <T>(); foreach (T item in referenceArray) { lockList.Add(item); } return(lockList); }
/// <summary> /// (Cross-Game compatible) Return as LockList /// </summary> public static LockList <Il2CppSystem.Object> ToLockList(this IEnumerator enumerator) { LockList <Il2CppSystem.Object> lockList = new LockList <Il2CppSystem.Object>(); while (enumerator.MoveNext()) { lockList.Add(enumerator.Current); } return(lockList); }
/// <summary> /// Not Tested /// </summary> public static LockList <T> ToLockList <T>(this SizedList <T> sizedList) { LockList <T> lockList = new LockList <T>(); for (int i = 0; i < sizedList.count; i++) { lockList.Add(sizedList[i]); } return(lockList); }
/// <summary> /// (Cross-Game compatible) Return as LockList /// </summary> public static LockList <T> ToLockList <T>(this IEnumerable <T> enumerable) { LockList <T> lockList = new LockList <T>(); for (int i = 0; i < enumerable.Count(); i++) { lockList.Add(enumerable.ElementAt(i)); } return(lockList); }
/// <summary> /// (Cross-Game compatible) Return a duplicate of this as type TCast /// </summary> /// <typeparam name="TSource"></typeparam> /// <typeparam name="TCast"></typeparam> /// <param name="list"></param> /// <returns></returns> public static LockList <TCast> DuplicateAs <TSource, TCast>(this LockList <TSource> list) where TSource : Il2CppSystem.Object where TCast : Il2CppSystem.Object { LockList <TCast> newList = new LockList <TCast>(); for (int i = 0; i < list.Count; i++) { newList.Add(list[i].TryCast <TCast>()); } return(newList); }
/// <summary> /// (Cross-Game compatible) Return as LockList /// </summary> public static LockList <T> ToLockList <T>(this IEnumerable <T> enumerable) where T : Il2CppSystem.Object { LockList <T> lockList = new LockList <T>(); var enumerator = enumerable.GetEnumeratorCollections(); while (enumerator.MoveNext()) { lockList.Add(enumerator.Current.Cast <T>()); } return(lockList); }
public void push(T item) { m_list.Add(item); }