Testing
Baked uses NUnit for unit testing, Moq for mocking and Shouldly for assertion.
app.Layers.AddTesting();
Configuration Targets
Testing
layer only exposes TestConfiguration
for configuration target.
TestConfiguration
This target is provided in AddServices
phase. To configure it in a feature;
configurator.ConfigureTestConfiguration(test =>
{
...
});
Phases
This layer introduces following phases to the application it is added;
CreateConfigurationManager
: This phase runs as the earliest stage of a test run to add an emptyConfigurationManager
to the application contextBuild
: This phase is added to the application internally to build anIServiceProvider
from registered services and add to the application context so that it can be used during the test run and trigger later phases