abp icon indicating copy to clipboard operation
abp copied to clipboard

Abstract all db-related tests in the domain test project

Open jflaga opened this issue 3 years ago • 1 comments

@maliming asked me to create an issue to abstract all db-related tests in the domain. then implement these in ef and mongo test projects, because I asked the question "why does DomainTestModule depends on EntityFrameworkCoreTestModule?" here

This is the content of the question:

I have a question about the generated DomainTestModule for ABP. There is a comment at the top saying "... however your domain tests should be database independent anyway",


/* Domain tests are configured to use the EF Core provider.
 * You can switch to MongoDB, however your domain tests should be
 * database independent anyway.
 */
[DependsOn(
    typeof(SampleEntityFrameworkCoreTestModule)
    )]
public class SampleDomainTestModule : AbpModule
{

}

but DomainTestModule depends on EntityFrameworkCoreTestModule.

Is this a mistake?
If it's not a mistake, is it okay, or even recommended, to remove the DomainTestModule's dependency on EntityFrameworkCoreTestModule?
If it's not recommended to remove it, what are the reason(s) why DomainTestModule depends on EntityFrameworkCoreTestModule?

Thanks

jflaga avatar Aug 26 '23 15:08 jflaga

why does DomainTestModule depends on EntityFrameworkCoreTestModule

We will change this behavior. Make them independent.

abstract all db-related tests in the domain. then implement these in ef and mongo test projects,

maliming avatar Aug 27 '23 01:08 maliming