Esempio 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"));
        }
Esempio 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]);
        }
Esempio n. 3
0
        public void insert_throws_if_value_is_null()
        {
            var record = new ConcreteRecordBase();

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

            Assert.Throws <NotSupportedException>(() => record.Insert(0, "one"));
        }
Esempio 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]);
 }
Esempio n. 6
0
 public void insert_throws_if_value_is_null()
 {
     var record = new ConcreteRecordBase();
     Assert.Throws<ArgumentNullException>(() => record.Insert(0, null));
 }
Esempio n. 7
0
 public void insert_throws_if_read_only()
 {
     var record = new ConcreteRecordBase(true);
     Assert.Throws<NotSupportedException>(() => record.Insert(0, "one"));
 }
Esempio 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"));
 }