Skip to content

Good practices in testing

Devrath edited this page Jul 4, 2021 · 4 revisions

Having only one assertion for test case

  • This is meaning there should be one test checking per test case.
  • This is important because we give a name for a test case, when a test fails with the name of the test case only we should be able to understand the reason for the failure.
  • Sometimes in a test might require multiple assertions, This is when in a UI test we want. to check the live data is emitted when the progress is starting to load and live data is emitted when the progress had to be dismissed, in any other scenario there should be one assertion per test case.

Clone this wiki locally