You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ExpectedException(typeof(FluentCheckException),ExpectedMessage="\nThe checked object must be null.\nThe checked object:\n\t[System.Object]")]
51
+
publicvoidIsNullFailsProperly()
52
+
{
53
+
Check.That(newobject()).IsNull();
54
+
}
55
+
56
+
[Test]
57
+
publicvoidIsNotNullWork()
58
+
{
59
+
Check.That(newobject()).IsNotNull();
60
+
}
61
+
62
+
[Test]
63
+
[ExpectedException(typeof(FluentCheckException),ExpectedMessage="\nThe checked object must not be null.\nThe checked object:\n\t[null]")]
64
+
publicvoidIsNotNullFailsProperly()
65
+
{
66
+
Check.That((object)null).IsNotNull();
67
+
}
68
+
43
69
[Test]
44
70
[ExpectedException(typeof(FluentCheckException),ExpectedMessage="\nThe checked object must have be an instance distinct from expected one.\nThe checked object:\n\t[System.Object]\nThe expected object: distinct from\n\t[System.Object]")]
Copy file name to clipboardExpand all lines: NFluent/Assertions/ObjectCheckExtensions.cs
+52Lines changed: 52 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,58 @@ public static ICheckLink<ICheck<object>> InheritsFrom<T>(this ICheck<object> che
149
149
string.Format("\nThe checked expression is part of the inheritance hierarchy or of the same type than the specified one.\nIndeed, checked expression type:\n\t[{0}]\nis a derived type of\n\t[{1}].",instanceType.ToStringProperlyFormated(),expectedBaseType.ToStringProperlyFormated()));
150
150
}
151
151
152
+
/// <summary>
153
+
/// Checks that the actual expression is null.
154
+
/// </summary>
155
+
/// <param name="check">The fluent check to be extended.</param>
156
+
/// <returns>A check link.</returns>
157
+
/// <exception cref="FluentCheckException">Is the value is not null.</exception>
0 commit comments