public void ViewWithExc() { int[] inner = new int[] { 3, 4, 6, 5, 7 }; WrappedArray <int> outerwrapped = new WrappedArray <int>(inner); WrappedArray <int> wrapped = (WrappedArray <int>)outerwrapped.View(1, 3); // try { wrapped.Add(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.AddAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Clear(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } //Should not throw //try { wrapped.Dispose(); Assert.Fail("No throw"); } //catch (FixedSizeCollectionException) { } int j = 1; try { wrapped.FindOrAdd(ref j); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Insert(1, 1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Insert(wrapped.View(0, 0), 1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertAll(1, null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertFirst(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertLast(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Remove(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Remove(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAllCopies(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAt(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveFirst(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveInterval(0, 0); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveLast(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RetainAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Update(1, out j); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.UpdateOrAdd(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } }
public void WithExc() { WrappedArray <int> wrapped = new WrappedArray <int>(new int[] { 3, 4, 6, 5, 7 }, MemoryType); // try { wrapped.Add(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.AddAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Clear(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Dispose(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } int j = 1; try { wrapped.FindOrAdd(ref j); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Insert(1, 1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Insert(wrapped.View(0, 0), 1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertAll(1, null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertFirst(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertLast(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Remove(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Remove(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAllCopies(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAt(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveFirst(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveInterval(0, 0); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveLast(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RetainAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Update(1, out j); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.UpdateOrAdd(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } }
public void WithExc() { WrappedArray<int> wrapped = new WrappedArray<int>(new int[] { 3, 4, 6, 5, 7 }); // try { wrapped.Add(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.AddAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Clear(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Dispose(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } int j = 1; try { wrapped.FindOrAdd(ref j); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Insert(1, 1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Insert(wrapped.View(0, 0), 1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertAll(1, null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertFirst(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.InsertLast(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Remove(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Remove(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAllCopies(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveAt(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveFirst(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveInterval(0, 0); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RemoveLast(); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.RetainAll(null); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.Update(1, out j); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } try { wrapped.UpdateOrAdd(1); Assert.Fail("No throw"); } catch (FixedSizeCollectionException) { } }