Activity Forums Salesforce® Discussions How many types of asserts() methods are used in Salesforce?

  • MOHIT

    Member
    February 19, 2020 at 6:27 am

    As per my knowledge 3 type of assert method is generally used in System Class in Salesforce.

    These are as follows:

    assert(condition, msg)
    Asserts that the specified condition is true. If it is not, a fatal error is returned that causes code execution to halt.
    assertEquals(expected, actual, msg)
    Asserts that the first two arguments are the same. If they are not, a fatal error is returned that causes code execution to halt.
    assertNotEquals(expected, actual, msg)
    Asserts that the first two arguments are different. If they are the same, a fatal error is returned that causes code execution to halt.

  • Ratnesh

    Member
    February 19, 2020 at 1:29 pm

    There are 3 types of assert methods that are generally used in System Class in Salesforce.

    • assert(condition, msg)
    • assertNotEquals(expected, actual, msg)
    • assertEquals(expected, actual, msg)
    • This reply was modified 4 years, 9 months ago by  Forcetalks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos