| Start |
|---|
Testing a block of code or some method:
Feed the dummy data to the method under test if required & then compare the expected & actual results. |
Testing asynchronous block of code:
|
| Measuring Performance of a block of code: 1. For Synchronous methods : 2. For Asynchronous methods :
|
| Running Test Suits: Run all tests by choosing Product > Test. Click the Test Navigator icon to view the status and results of the tests. You can add a test target to a project (or add a class to a test) by clicking the Add (plus) button in the bottom-left corner of the test navigator. To view the source code for a particular test, select it from the test list. The file opens in the source code editor. |
| Note: Make sure that include unit test case box is checked when creating a new project as shown below:
RemarksDependencies:
Get brushed up before starting: Appendix: There are several other methods for comparing the expected result & actual result out of an operation. Some of those methods are listed below:
|
Read Article
https://develop.horje.com/learn/1434/reference