What does assert.areequal do?

204    Asked by Amitraj in QA Testing , Asked on May 9, 2022

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

Answered by Amit jaisawal

You can use Assertions to verify something is in a certain state. Normally you compare the actual against the expected 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. :smile: Asserts are often used in unit-tests and automated integration tests to give feedback or actually test something during a test run.



Your Answer

Interviews

Parent Categories