运行测试的异常“无法注册IUserAppService”

问题描述 投票:0回答:1

我正在尝试运行ABP解决方案(3.8.1)附带的默认测试,我得到以下异常Abp.AbpException: 'Can not register IUserAppService. It should be a non-abstract class. If not, it should be registered before.'

我们已经在这个项目上工作了几个月而没有经过测试,但我们希望以测试为导向,但我无法弄清楚为什么我们会得到这个例外。

这是UserAppService的构造函数,因此您可以看到注入的内容:

public class UserAppService : EEIPFactoriesAppServiceBase
{
    private readonly RoleManager roleManager;
    private readonly IRepository<AppFactory> appFactoryRepository;
    private readonly IPasswordHasher<User> passwordHasher;
    private readonly BackgroundJobManager backgroundJobManager;
    private readonly HostConfiguration hostConfiguration;
    private readonly EmailTemplateManager templateManager;
    private readonly AppFactoryManager appFactoryManager;
    private readonly IRepository<RolePermissionSetting, long> permissionRepository;
    private readonly ISyncHub syncHub;

    public UserAppService(
        UserManager userManager,
        TenantManager tenantManager,
        BackgroundJobManager backgroundJobManager,
        RoleManager roleManager,
        EmailTemplateManager templateManager,
        HostConfiguration hostConfiguration,
        AppFactoryManager appFactoryManager,
        IRepository<RolePermissionSetting, long> permissionRepository,
        IRepository<AppFactory> appFactoryRepository,
        IPasswordHasher<User> passwordHasher,
        ISyncHub syncHub)
    {
        UserManager = userManager;
        TenantManager = tenantManager;
        this.roleManager = roleManager;
        this.backgroundJobManager = backgroundJobManager;
        this.passwordHasher = passwordHasher;
        this.appFactoryRepository = appFactoryRepository;
        this.hostConfiguration = hostConfiguration;
        this.appFactoryManager = appFactoryManager;
        this.templateManager = templateManager;
        this.permissionRepository = permissionRepository;
        this.syncHub = syncHub;
    }
...
}
aspnetboilerplate
1个回答
2
投票

让它实现IUserAppService

public class UserAppService : EEIPFactoriesAppServiceBase, IUserAppService
© www.soinside.com 2019 - 2024. All rights reserved.