public void TestContains() { ArrayList4Asserter.AssertContains( ArrayList4Asserter.CreateArrayList(10), -1, ArrayList4Asserter.ValueForIndex(10) + 1); }
private static IEnumerable <int> GetEnumerable(int start, int end) { for (int i = start; i < end; i++) { yield return(ArrayList4Asserter.ValueForIndex(i)); } }
public void TestFailEnumerator() { ArrayList4Asserter.AssertFailEnumerator <int>( ArrayList4Asserter.CreateArrayListAndAssertValues(10), GetEnumerable(0, 10), 6, 20); }
public void TestContains() { ArrayList4Asserter.AssertContains( RetrieveOnlyInstance <string>(), "there's no such thing as free lunch!", "0.1", " 10"); }
public void TestRemoveAt() { ArrayList4Asserter.AssertRemoveAt( ArrayList4Asserter.CreateArrayListAndAssertValues(10), new IndexOfItems <int, Type>(-1, typeof(ArgumentOutOfRangeException)), new IndexOfItems <int, Type>(10, typeof(ArgumentOutOfRangeException)), new IndexOfItems <int, Type>(50, typeof(ArgumentOutOfRangeException)), new IndexOfItems <int, Type>(5, typeof(int))); }
public void TestIndexOf() { ArrayList4Asserter.AssertIndexOf( ArrayList4Asserter.CreateArrayListAndAssertValues(10), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(0), 0), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(10), -1), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(-8), -1), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(5), 5)); }
public void TestIndexOf() { ArrayList4Asserter.AssertIndexOf( RetrieveOnlyInstance <string>(), new IndexOfItems <string, int>("10", 10), new IndexOfItems <string, int>("911", -1), new IndexOfItems <string, int>("0", 0), new IndexOfItems <string, int>("49", 49), new IndexOfItems <string, int>("50", -1)); }
public void TestBinarySearch() { ArrayList4Asserter.AssertBinarySearch( (ArrayList4 <int>)ArrayList4Asserter.CreateArrayListAndAssertValues(100), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(0), 0), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(99), 99), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(50), 50), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(100), -1), new IndexOfItems <int, int>(ArrayList4Asserter.ValueForIndex(-1), -1)); }
public void TestRemoveAt() { IList <string> list = RetrieveOnlyInstance <string>(); ArrayList4Asserter.AssertRemoveAt( list, new IndexOfItems <int, Type>(-1, typeof(ArgumentOutOfRangeException)), new IndexOfItems <int, Type>(list.Count, typeof(ArgumentOutOfRangeException)), new IndexOfItems <int, Type>(0, typeof(int)), new IndexOfItems <int, Type>(list.Count - 2, typeof(int))); }
public void TestToString() { ArrayList4Asserter.AssertToString( ArrayList4Asserter.CreateArrayListAndAssertValues(10), "ArrayList4<Int32> (Count=10)"); ArrayList4Asserter.AssertToString( new ArrayList4 <int>(0), "ArrayList4<Int32> (Count=0)"); ArrayList4Asserter.AssertToString( new ArrayList4 <string>(0), "ArrayList4<String> (Count=0)"); }
public void TestRemove() { ArrayList4Asserter.AssertRemove( RetrieveOnlyInstance <string>(), new IndexOfItems <string, bool>("-1", false), new IndexOfItems <string, bool>(SIZE.ToString(), false), new IndexOfItems <string, bool>((SIZE - 1).ToString(), true), new IndexOfItems <string, bool>((SIZE - 1).ToString(), false), new IndexOfItems <string, bool>("20", true), new IndexOfItems <string, bool>("0", true), new IndexOfItems <string, bool>("1", true)); }
public void TestSort() { ArrayList4 <int> list = (ArrayList4 <int>)ArrayList4Asserter.CreateArrayListAndAssertValues(100); list.Sort(0, list.Count, new InverseComparer()); Assert.IsGreaterOrEqual(1, list.Count); for (int i = 1; i < list.Count; i++) { if (list[i - 1] < list[i]) { Assert.Fail(String.Format("Indexes ({0}, {1}). Values ({2}, {3})", i, i - 1, list[i], list[i - 1])); } } }
public void TestInsert() { ArrayList4Asserter.AssertInsert( new ArrayList4 <int>(0), new int[] { 1, 2, 3 }, new IndexOfItems <int, int>(1, 0), new IndexOfItems <int, int>(2, 1), new IndexOfItems <int, int>(3, 2)); ArrayList4Asserter.AssertInsert( new ArrayList4 <int>(new int[] { 3, 2, 1 }), new int[] { 3, 4, 2, 5, 1, 6 }, new IndexOfItems <int, int>(4, 1), new IndexOfItems <int, int>(5, 3), new IndexOfItems <int, int>(6, 5)); }
public void TestCopyToInvalidIndex() { ArrayList4Asserter.AssertCopyToInvalidIndex(RetrieveOnlyInstance <string>()); }
public void TestCopyToWithInvalidSize() { ArrayList4Asserter.AssertCopyToWithInvalidSize(ArrayList4Asserter.CreateArrayList(10)); }
public void TestCopyTo() { ArrayList4Asserter.AssertCopyTo(ArrayList4Asserter.CreateArrayList(10)); }
public void TestCopyToWithNullTarget() { ArrayList4Asserter.AssertCopyToWithNullTarget(RetrieveOnlyInstance <string>()); }
public void TestUpperBound() { ArrayList4Asserter.AssertUpperBound(); }
public void TestAddDifferentTypes() { ArrayList4Asserter.TestAddDifferentTypes(RetrieveOnlyInstance <string>(), 20); }
public void TestLowerBound() { ArrayList4Asserter.AssertLowerBound(ArrayList4Asserter.CreateArrayListAndAssertValues(10)); }
public void TestAddDifferentTypes() { ArrayList4Asserter.TestAddDifferentTypes(ArrayList4Asserter.CreateArrayListAndAssertValues(10), "No way my friend"); }
public void TestEnumerator() { ArrayList4Asserter.AssertEnumerable( RetrieveOnlyInstance <string>(), GetEnumerable(SIZE)); }
public void TestItems() { ArrayList4Asserter.AssertItems(); }
public void TestEnumerator() { ArrayList4Asserter.AssertEnumerable( ArrayList4Asserter.CreateArrayListAndAssertValues(10), GetEnumerable(0, 10)); }
public void TestLowerBound() { ArrayList4Asserter.AssertLowerBound(RetrieveOnlyInstance <string>()); }
public void TestAddItems() { ArrayList4Asserter.AssertAddItem(); }
public void TestIsReadOnly() { ArrayList4Asserter.AssertIsReadOnly(); }
public void TestClear() { ArrayList4Asserter.AssertClear(); }
public void TestCopyToMultiDimensionalArray() { ArrayList4Asserter.AssertCopyToWithMultiDimensionalArray(ArrayList4Asserter.CreateArrayList(10)); }
public void TestRemove() { ArrayList4Asserter.AssertRemove <int>(ArrayList4Asserter.CreateArrayListAndAssertValues(10)); }