Primitive ValueType Assertions

			var minvalue = long.MinValue;
			var maxvalue = long.MaxValue;
			...

			minvalue.Should().Be.LessThan(maxvalue);
			maxvalue.Should().Be.GreaterThan(minvalue);
			minvalue.Should().Be.EqualTo(minvalue);
			minvalue.Should().Be.LessThanOrEqualTo(minvalue);
			minvalue.Should().Be.LessThanOrEqualTo(minvalue + 1);
			maxvalue.Should().Be.GreaterThanOrEqualTo(maxvalue);
			maxvalue.Should().Be.GreaterThanOrEqualTo(maxvalue - 1);
			minvalue.Should().Be.IncludedIn(minvalue, maxvalue);
			(minvalue + 1).Should().Be.IncludedIn(minvalue, maxvalue);

For Nullable<T> where T : struct, IComparable

For Nullable types is available, in addition, the syntax
			int? nullable = null;
			nullable.Should().Not.Have.Value();

Examples with negation and chain

			actual.Should().Be.GreaterThan(3).And.Not.Be.EqualTo(5);
			actual.Should().Not.Be.GreaterThan(3).And.Not.Be.EqualTo(0);

Last edited Oct 29, 2009 at 1:13 PM by fabiomaulo, version 3

Comments

No comments yet.