Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 1.56 KB

File metadata and controls

46 lines (39 loc) · 1.56 KB
uid level summary
testing
300
The document outlines three strategies for testing aspects: compile-time tests, run-time tests, and traditional unit tests, each serving different purposes and scenarios.

Testing aspects

There are three complementary strategies to test your aspects. The first strategy should provide sufficient coverage for the most common scenarios.

Article Description
These tests verify that the aspect transforms code or reports errors and warnings as expected. In compile-time tests, the transformed code is not executed.
These tests confirm the run-time behavior of the aspect. In this approach, you apply your aspect to some test target code and evaluate the _behavior_ of the combination of the aspect and the target code by executing the transformed code in a unit test and assessing its run-time behavior. For this approach, you can use a conventional Xunit project or any other testing framework, as there is nothing specific to Metalama.
These tests are traditional unit tests of the compile-time logic used by the aspects, without executing the aspects themselves.

[!div class="see-also"] xref:video-testing