There are these two methods in the NUnit.Framework.Assert
namespace.
I just cannot find what's the difference between them. I'm also curious when to use which one.
Verifies that the object that is passed in is not equal to null If the object is null then an AssertionException is thrown. NotNull(Object) Verifies that the object that is passed in is not equal to null If the object is null then an AssertionException is thrown. NotNull(Object, String)
IsNotNull(Object) Tests whether the specified object is non-null and throws an exception if it is null.
Two forms are provided for the True, False, Null and NotNull conditions. The "Is" forms are compatible with earlier versions of the NUnit framework, while those without "Is" are provided for compatibility with NUnitLite.
Got it here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With