Rasagar/Library/PackageCache/com.unity.test-framework/Documentation~/course/welcome.md
2024-08-26 23:07:20 +03:00

2.6 KiB

Welcome

Welcome to the Unity Test Framework general introduction course.

This course consists of different exercises to help you learn fundamental Unity Test Framework concepts through practical examples. Each exercise has a Learning Objectives section to help you identify the skills you will learn. The exercises are grouped thematically, and their difficulty varies.

After completing an exercise, you can check your solution against the one provided. Note that many of the exercises can be solved in several possible ways.

Import samples

Project files for each exercise and its accompanying solution are provided as samples with the Unity Test Framework package. To import an exercise or solution to your Unity Editor:

  1. Go to Window > Package Manager and, in the packages list view, selct Unity Test Framework.
  2. In the package details view, find the Samples section.
  3. Find the exercise or solution you want to import and click the import button.

Note: You can import an exercise and its solution or multiple exercises at the same time, but since several of the exercises use the same naming pattern this will likely result in compilation errors that prevent you running tests or building your project. The recommended workflow is to import and work on one exercise at a time. If you import additional exercises or solutions for reference, you can delete them again before running your main exercise.

Course outline

  1. Running a test in a Unity project
  2. Arrange, act, assert
  3. Semantic test assertion
  4. Custom comparison
  5. Asserting logs
  6. Setup and teardown
  7. Play mode tests
  8. Play mode tests in a player
  9. Using the UnityTest attribute
  10. Long-running tests
  11. Scene-based tests
  12. Setup and cleanup at build time
  13. Domain reload
  14. Preserve test state
  15. Test cases
  16. Custom attributes
  17. Running tests programmatically

Introduction to the Unity Test Framework (UTF)

Here you can find a video introduction to the Unity Test Framework.