Example #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"));
 }
        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"));
        }
Example #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"));
 }
        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"));
        }
        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"));
        }
        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"));
        }
Example #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"));
 }
Example #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"));
 }