shouldly/shouldly — Issue #36: Should.(Not)BeNull( obj )
Author: benjamine
Created: 2011-10-31 14:01:21+00:00
State: open

I think an assertion for detecting null values is missing. eg:

Should.BeNull(myvar);
Should.NotBeNull(myvar);

(note that myvar.ShouldBeNull() doesn't make sense here, beacuse if myvar is null that line will throw a regular NullException)

also, an optional message would be nice:

Products.Delete(pid1);
var product = Products.Find(pid1);
Should.BeNull(product, "Product not removed correctly");

or:

Should.BeNull(product).Otherwise("Product not removed correctly");