public void blow_up_with_descriptive_message_if_the_column_does_not_exist()
 {
     var match = new DataColumnMatch("Foo", typeof(int));
     Exception<StorytellerAssertionException>.ShouldBeThrownBy(() =>
     {
         match.GetValue(table.Rows[0]);
     }).Message.ShouldContain("Requested column 'Foo' does not exist");
 }
예제 #2
0
            public CellModifications Column(string columnName, Type columnType)
            {
                var match = new DataColumnMatch(columnName, columnType);

                Matches.Add(match);

                return(match.CellModifications);
            }
        public void SetUp()
        {
            table = new DataTable();
            table.Columns.Add("City", typeof(string));
            table.Columns.Add("Distance", typeof(int));
            table.Columns.Add("Zip", typeof(string));

            table.Rows.Add("Austin", 16, "78704");
            table.Rows.Add("London", 8192, "");
            table.Rows.Add("Paris", 4096, null);

            _matchCity = new DataColumnMatch("City", typeof(string));
            _matchDistance = new DataColumnMatch("Distance", typeof(int));
            _matchZip = new DataColumnMatch("Zip", typeof(string));
        }