-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Jitendra Selvam edited this page Jul 20, 2018
·
1 revision
- Open Test explorer by navigating to Tests > Windows > Test Explorer.
- Build the project to see unit tests in test explorer.
- Refer SimpleFunctions and SimpleFunctionsTests classes first.
- MainFunctionClass has SomeFunctions class injected.
- Used NSubstitute to mock SomeFunctions during object creation of MainFunctionClass in unit tests.
- Each of the test cases have an Arrange (optional), Action and Assert step following the AAA pattern.
- We mock the output of the dependent functions and test the function under consideration to see if it behaves normally for various scenarios of the dependent functions (Arrange step).
- Call the function to be tested after dependent functions are mocked (Action step).
- Check the results with expected and actual values (Assert step).