Booleans

Edit this page

bool theBoolean = false;
theBoolean.Should().BeFalse("it's set to false");

theBoolean = true;
theBoolean.Should().BeTrue();
theBoolean.Should().Be(otherBoolean);

Obviously the above assertions also work for nullable booleans, but if you really want to be make sure a boolean is either true or false and not null, you can use these methods.

theBoolean.Should().NotBeFalse();
theBoolean.Should().NotBeTrue();