Building integration tests
In this section, we will see how to build automated tests for your services as integrated into ABP Framework and other infrastructure components. We will start by understanding ABP integration, how the database is used in integration tests, and how to create initial test data. Then, we will write example tests for repositories, domain, and application services. Let's start with ABP integration.
Understanding ABP integration
ABP provides the Volo.Abp.TestBase
NuGet package, which includes the AbpIntegratedTest<TStartupModule>
base class for our integration tests. We can inherit from that class to write tests as completely integrated to ABP Framework. The following example shows the main parts of such a test class:
public class SampleTestClass : AbpIntegratedTest<MyTestModule> { private IMyService _myService; public SampleTestClass() { ...