Exemplo n.º 1
0
        public void insert_throws_if_index_is_invalid()
        {
            var record = new ConcreteRecordBase();

            Assert.Throws <ArgumentOutOfRangeException>(() => record.Insert(-1, "one"));
            Assert.Throws <ArgumentOutOfRangeException>(() => record.Insert(10, "one"));
        }
Exemplo n.º 2
0
        public void insert_inserts_value_at_specified_index()
        {
            var record = new ConcreteRecordBase("two", "four");

            record.Insert(1, "three");
            record.Insert(0, "one");
            Assert.Equal(4, record.Count);
            Assert.Equal("one", record[0]);
            Assert.Equal("two", record[1]);
            Assert.Equal("three", record[2]);
            Assert.Equal("four", record[3]);
        }
Exemplo n.º 3
0
        public void insert_throws_if_value_is_null()
        {
            var record = new ConcreteRecordBase();

            Assert.Throws <ArgumentNullException>(() => record.Insert(0, null));
        }
Exemplo n.º 4
0
        public void insert_throws_if_read_only()
        {
            var record = new ConcreteRecordBase(true);

            Assert.Throws <NotSupportedException>(() => record.Insert(0, "one"));
        }
Exemplo n.º 5
0
 public void insert_inserts_value_at_specified_index()
 {
     var record = new ConcreteRecordBase("two", "four");
     record.Insert(1, "three");
     record.Insert(0, "one");
     Assert.Equal(4, record.Count);
     Assert.Equal("one", record[0]);
     Assert.Equal("two", record[1]);
     Assert.Equal("three", record[2]);
     Assert.Equal("four", record[3]);
 }
Exemplo n.º 6
0
 public void insert_throws_if_value_is_null()
 {
     var record = new ConcreteRecordBase();
     Assert.Throws<ArgumentNullException>(() => record.Insert(0, null));
 }
Exemplo n.º 7
0
 public void insert_throws_if_read_only()
 {
     var record = new ConcreteRecordBase(true);
     Assert.Throws<NotSupportedException>(() => record.Insert(0, "one"));
 }
Exemplo n.º 8
0
 public void insert_throws_if_index_is_invalid()
 {
     var record = new ConcreteRecordBase();
     Assert.Throws<ArgumentOutOfRangeException>(() => record.Insert(-1, "one"));
     Assert.Throws<ArgumentOutOfRangeException>(() => record.Insert(10, "one"));
 }