Skip to content
Jitendra Selvam edited this page Jul 20, 2018 · 1 revision

Welcome to the XunitWithNSubstitute wiki!

Information about the Project

  • 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.

Information about test cases

  • 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).
Clone this wiki locally