コード例 #1
0
                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())));
                }
コード例 #2
0
            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();
                    }
                });
            }