Exemplo n.º 1
0
 public void get_column_index_or_null_returns_column_index_if_present()
 {
     var header = new HeaderRecord(new string[] { "Name", "Age", "Gender" });
     Assert.Equal(0, header.GetColumnIndexOrNull("Name"));
     Assert.Equal(1, header.GetColumnIndexOrNull("Age"));
     Assert.Equal(2, header.GetColumnIndexOrNull("Gender"));
 }
Exemplo n.º 2
0
        public void get_column_index_or_null_returns_column_index_if_present()
        {
            var header = new HeaderRecord(new string[] { "Name", "Age", "Gender" });

            Assert.Equal(0, header.GetColumnIndexOrNull("Name"));
            Assert.Equal(1, header.GetColumnIndexOrNull("Age"));
            Assert.Equal(2, header.GetColumnIndexOrNull("Gender"));
        }
Exemplo n.º 3
0
 public void get_column_index_or_null_returns_null_if_column_is_not_found()
 {
     var header = new HeaderRecord(new string[] { "Name", "Age", "Gender" });
     Assert.Null(header.GetColumnIndexOrNull("Foo"));
     Assert.Null(header.GetColumnIndexOrNull("name"));
     Assert.Null(header.GetColumnIndexOrNull("Age "));
     Assert.Null(header.GetColumnIndexOrNull("GENDER"));
 }
Exemplo n.º 4
0
        public void get_column_index_or_null_returns_null_if_column_is_not_found()
        {
            var header = new HeaderRecord(new string[] { "Name", "Age", "Gender" });

            Assert.Null(header.GetColumnIndexOrNull("Foo"));
            Assert.Null(header.GetColumnIndexOrNull("name"));
            Assert.Null(header.GetColumnIndexOrNull("Age "));
            Assert.Null(header.GetColumnIndexOrNull("GENDER"));
        }
Exemplo n.º 5
0
        public void clear_updates_indexes_appropriately()
        {
            var header = new HeaderRecord("Name", "Age", "Gender");

            Assert.Equal(0, header["Name"]);
            Assert.Equal(1, header["Age"]);
            Assert.Equal(2, header["Gender"]);
            header.Clear();
            Assert.Null(header.GetColumnIndexOrNull("Name"));
            Assert.Null(header.GetColumnIndexOrNull("Age"));
            Assert.Null(header.GetColumnIndexOrNull("Gender"));
        }
Exemplo n.º 6
0
        public void indexer_set_updates_indexes_appropriately()
        {
            var header = new HeaderRecord("Name", "Age", "Gender");

            Assert.Equal(1, header["Age"]);
            header[1] = "New";
            Assert.Equal(1, header["New"]);
            Assert.Null(header.GetColumnIndexOrNull("Age"));
        }
Exemplo n.º 7
0
 public void clear_updates_indexes_appropriately()
 {
     var header = new HeaderRecord("Name", "Age", "Gender");
     Assert.Equal(0, header["Name"]);
     Assert.Equal(1, header["Age"]);
     Assert.Equal(2, header["Gender"]);
     header.Clear();
     Assert.Null(header.GetColumnIndexOrNull("Name"));
     Assert.Null(header.GetColumnIndexOrNull("Age"));
     Assert.Null(header.GetColumnIndexOrNull("Gender"));
 }
Exemplo n.º 8
0
 public void indexer_set_updates_indexes_appropriately()
 {
     var header = new HeaderRecord("Name", "Age", "Gender");
     Assert.Equal(1, header["Age"]);
     header[1] = "New";
     Assert.Equal(1, header["New"]);
     Assert.Null(header.GetColumnIndexOrNull("Age"));
 }