What Assert.AreEqual(true, true); does?



  • Can any one explain Assert.AreEqual(true, true); with proper example and explanation?



  • You can use Assertions to verify something is in a certain state. Normally you compare the actual against the excepted state.

    Example usage:

    • Do some steps in your application
    • Gather the value of a field
    • Assert that the value is indeed the value you expect

      Assert.AreEqual(Actual, Expected)

    This could give an assertion failure if Actual and Expected differ. During a test run you should not have any assertion failures. 🙂

    Asserts are often used in unit-tests and automated integration tests to give feedback or actually test something during a test run.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2