Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 8 Β· Quiz
Testing Data Access and Controllers
1. What is the main reason why EF Core InMemory provider is considered the least reliable for testing data access?
It simulates a SQL Server environment.
It does not enforce foreign key constraints.
It is not fast enough for quick tests.
It can't perform transactions.
2. Which of the following testing strategies is recommended for controller tests?
Mocking all external services and resources.
Instantiating controllers with real services only.
Using raw SQL directly in tests.
Testing only the result types and model returned.
3. What happens if you call a controller action directly without setting up ModelState?
ModelState is always valid.
The action will fail immediately.
ModelState will contain errors automatically.
The specified view will never be returned.
4. What is a common mistake that developers make regarding ModelState during controller testing?
Assuming ModelState is always valid after direct action calls.
Forgetting to test the controller at all.
Calling the model's constructor instead of the action.
Testing a non-existent model state.
Submit answers
Continue: Test Data and CI β
Review this lesson
Retake quiz