Q:

Extension method doesn't throw exception as expected

I have the following extension methods:
public static T ToObject<T>(this DataRow row) where T : new()
{
    if (row == null) throw new ArgumentNullException("row");

    // do something
}

public static IEnumerable<T> ToObject<T>(this DataTable table) where T : new()
{
    if (table == null) throw new ArgumentNullException("table");

    // do something
}

And the respective tests:
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
public void NullDataRow()
{
    // Arrange
    DataRow row = null;

    // Act
    row.ToObject<SomeData>();
}

[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
public void NullDataTable()
{
    // Arrange
    DataTable table = null;

    // Act
    table.ToObject<SomeData>();
}

The DataRow test passes (it throws ArgumentNullException normally) while the DataTable one doesn't (doesn't hit method nor throw anything).
I have absolutely no idea why the DataTable test isn't working (and the DataRow one is normal!).
(at first I thought it was a bug in my Visual Studio, but the CI service that I use accused the same)

A:

I'll assume the IEnumerable<T> isn't just for fun, and that the extension method is actually an iterator.
Such iterator, doesn't actually execute to the point of throwing the exception until you start iterating it.

