Exemplo n.º 1
0
        public void add_throws_if_there_is_already_a_column_with_the_same_name()
        {
            var header = new HeaderRecord("Name", "Age", "Gender");
            var ex     = Assert.Throws <InvalidOperationException>(() => header.Add("Age"));

            Assert.Equal("A column named 'Age' appears more than once in the header record.", ex.Message);
        }
Exemplo n.º 2
0
        public void add_updates_indexes_appropriately()
        {
            var header = new HeaderRecord("Name", "Age", "Gender");

            header.Add("Address");
            Assert.Equal(0, header["Name"]);
            Assert.Equal(1, header["Age"]);
            Assert.Equal(2, header["Gender"]);
            Assert.Equal(3, header["Address"]);
        }
Exemplo n.º 3
0
 public void add_throws_if_there_is_already_a_column_with_the_same_name()
 {
     var header = new HeaderRecord("Name", "Age", "Gender");
     var ex = Assert.Throws<InvalidOperationException>(() => header.Add("Age"));
     Assert.Equal("A column named 'Age' appears more than once in the header record.", ex.Message);
 }
Exemplo n.º 4
0
 public void add_updates_indexes_appropriately()
 {
     var header = new HeaderRecord("Name", "Age", "Gender");
     header.Add("Address");
     Assert.Equal(0, header["Name"]);
     Assert.Equal(1, header["Age"]);
     Assert.Equal(2, header["Gender"]);
     Assert.Equal(3, header["Address"]);
 }