When we write unit tests, we need to find out whether they pass or not. We need to execute the unit test and evaluate the result of it. If the test passes, everything runs fine. If the test fails, you need to find out why the test fails. Did you create the correct data? Is the result not the expected result? Maybe there's a scenario you didn't take into account while you were developing your code?
Let's look at how we can execute our code.
You can execute unit tests via your favorite IDE (VS Code , which is short for Visual Studio Code; IntelliJ with Illuminated Cloud; and Welkin Suite have built-in testing tools so that you can execute your unit tests), but you can also use your Developer Console.
Let's look at how we can execute our test method in the Developer Console:
- To start a unit test, open your Developer Console and click on...