Ejemplo n.º 1
0
        public void Insert_throws_expected_exceptions()
        {
            // ARRANGE
            var instance = new MdTable(new MdTableRow(MdEmptySpan.Instance));

            // ACT / ASSERT
            Assert.Throws <ArgumentNullException>(() => instance.Insert(0, null !));
            Assert.Throws <ArgumentOutOfRangeException>(() => instance.Insert(-1, new MdTableRow(MdEmptySpan.Instance)));
            Assert.Throws <ArgumentOutOfRangeException>(() => instance.Insert(2, new MdTableRow(MdEmptySpan.Instance)));
        }
Ejemplo n.º 2
0
        public void Insert_inserts_a_row_at_the_specifed_index_01()
        {
            // ARRANGE
            var instance = new MdTable(new MdTableRow(MdEmptySpan.Instance));
            var row      = new MdTableRow(MdEmptySpan.Instance);

            // ACT
            instance.Insert(0, row);

            // ASSERT
            Assert.Equal(1, instance.RowCount);
            Assert.Same(row, instance.Rows.Single());
        }
Ejemplo n.º 3
0
        public void Insert_inserts_a_row_at_the_specifed_index_03(int insertAt)
        {
            // ARRANGE
            var instance = new MdTable(new MdTableRow(MdEmptySpan.Instance))
            {
                new MdTableRow(MdEmptySpan.Instance),
                new MdTableRow(MdEmptySpan.Instance)
            };

            var row = new MdTableRow(MdEmptySpan.Instance);

            // ACT
            instance.Insert(insertAt, row);

            // ASSERT
            Assert.Equal(3, instance.RowCount);
            Assert.Same(row, instance.Rows.Skip(insertAt).First());
        }