These three methods have three different specific goals. The purpose of testing is to provide clear verification and verification of your code. Using the most understandable and specific method, you make your test the smallest, possibly the most concrete, understandable meaning.
This helps, because it adds clarity - you can see, in particular, what the test should do in a more declarative form, where using the same method for several test scripts, each of which has a different meaning, requires more understanding of the code itself, not the nature of the test.
In this case, the third is (only) suitable for use. However, if you had this situation, you would use a different one, for example:
Assert.IsTrue( myClass.MethodThatReturnsTrue() );
You should use a method that provides the most clarity regarding your goal - if you check two values ββfor equality, use Assert.IsEqual , if you check a boolean to make sure it is false, use Assert.IsFalse , This makes error messages meaningful and understandable.
Reed copsey
source share