-
Notifications
You must be signed in to change notification settings - Fork 0
Types of assertions
Devrath edited this page Oct 24, 2023
·
1 revision
-
Assertions
are usually used to test a function to check if what we are testing is working as expected
- We run a specific function with specific parameters and we check the result of the function.
- We later perform an assertion on that particular output.
- These tests are easy to write and maintain because even if the implementation changes still the test need not have to change
- Here we run some actions and functions that change the state of the system.
- The
system
can be anentire app
, aspecific class
in an app, etc. - In Android context, We can call it a
view model
-> Say we run some functions of the View model and see if the UI state is properly manipulated - Verifying the correct values into DB. Say inserting the values in DB and checking if the state is successful in the view model.
- These tests are easy to write but a bit hard to maintain.
- This is verifying that certain communication has happened between the classes.
- We verify that a particular function was called, we don't check the end result.
- These tests are hard to maintain.