public static void ThrowsExceptionUponListModification() { var list = new List2D <byte>(1, 1); list.AddRow(); list.AddColumn(); Assert.Throws <InvalidOperationException>( () => list.ForEach(new BoxedAction <byte>(o => list.AddColumn()))); }
public static void MoveNextThrowsExceptionUponListModification() { var list = new List2D <byte>(1, 1); list.AddRow(); list.AddColumn(); Assert.Throws <InvalidOperationException>(() => { foreach (byte item in list) { list.AddColumn(); } }); }