Unit Tests
- 2 minutes to read
You can use the Moq and NUnit frameworks to test your XAF application. Unlike the approach with EasyTest, this one does not require an XAF application or Object Space instances and Types Info Subsystem. This topic lists ways to test different parts of an XAF application.
EF Core Unit Tests
- Test Action state based on user permissions
- Test whether an Action changes property values
- Test event handlers in Controllers
- Test Action state based on target criteria in Detail View
- Test Action state based on selection dependency in List View
- Test New Action Custom Business Logic (New Object Inherits Parent Property Values)
- Test object queries by criteria and Detail View creation
- Test localized strings from CaptionHelper
- Web API Service Integration Tests
XPO Unit Tests
- Test Action state based on user permissions
- Test whether an Action changes property values
- Test event handlers in Controllers
- Test Action state based on target criteria in Detail View
- Test Action state based on selection dependency in List View
- Test New Action custom business logic based on parent and nested Views
- Test object queries by criteria and Detail View creation
- Test localized strings from CaptionHelper (Approach 1)
- Test localized strings from CaptionHelper (Approach 2)
- Test custom logic in XAF/XPO business classes
Refer to the following article for more information on APIs used in these examples: How to write lightweight unit tests for XAF Actions, Controllers and other custom UI logic.