public void It_should_throw_an_exception_when_the_range_does_not_specify_the_same_column() { _DataTable.Rows.Add("Value-1", "Value-2", "Value-3", "Value-4"); var exception = Assert.Throws <ArgumentException>(() => GroupByAggregation.GroupBy(_DataTable, "A1:C1")); Assert.AreEqual("The specified aggregation can only be performed on a single column.", exception.Message); }
public void It_should_throw_an_exception_when_the_column_index_is_invalid() { var grouping = DataRowGroupingBuilder.UseSchema(_DataTable) .Key("key") .Row("Value-1", 200M) .Row("Value-2", 300M) .Build(); var exception = Assert.Throws <ArgumentOutOfRangeException>(() => GroupByAggregation.GroupBy(new [] { grouping }, -1)); Assert.AreEqual($"DataRow does not have a column at index -1. (Parameter 'columnIndex')", exception.Message); }
public void It_should_throw_an_exception_when_the_range_parameter_is_null() { var exception = Assert.Throws <ArgumentNullException>(() => GroupByAggregation.GroupBy(_DataTable, string.Empty)); Assert.AreEqual($"Value cannot be null. (Parameter 'range')", exception.Message); }
public void It_should_throw_an_exception_when_the_table_parameter_is_null() { var exception = Assert.Throws <ArgumentNullException>(() => GroupByAggregation.GroupBy(null, "A1:A1")); Assert.AreEqual($"Value cannot be null. (Parameter 'table')", exception.Message); }
public void It_should_throw_an_exception_when_the_data_row_groupings_parameter_is_null() { var exception = Assert.Throws <ArgumentNullException>(() => GroupByAggregation.GroupBy(null, 0)); Assert.AreEqual($"Value cannot be null. (Parameter 'dataRowGroupings')", exception.Message); }