Written February 04, 2009 at 16:00 MST Tagged c sharp
If you recall from the last post on this topic one of the ways you can record an observation is by simply doing this:
[Observation]
public void should_dispose_the_appropriate_items()
{
connection.was_told_to(x => x.Dispose());
}
In addition to be able to define observations using traditional attributes. You can now also define observations by using blocks (like the rest of the code uses). So the following observation is identical to the one above:
it should_dispose_the_appropriate_items = () =>
connection.was_told_to(x => x.Dispose());
it should_leverage_db_infrastructure_to_return_a_set_of_rows_from_the_db = () =>
result.should_not_be_null();
[Observation]
public void should_dispose_the_appropriate_items()
{
connection.was_told_to(x => x.Dispose());
}