Can not register IAbpWebApiClient. It should be a non-abstract class. If not, it should be registered before
See original GitHub issueHi,
I am trying to test my AppService that use IAbpWebApiClient to call another AppService hosted on differnent website and this my test class:
public class UmiTest : MyTestBase
{
private readonly IUmiAppService _umiAppService;
private readonly IAbpWebApiClient _abpWebApiClient;
public UmiTest()
{
_abpWebApiClient = Resolve<IAbpWebApiClient>();
_umiAppService = Resolve<IUmiAppService>(_abpWebApiClient);
}
[Fact]
public async Task GetUserFollowersByRoleAsync()
{
var res = await _umiAppService.GetUserFollowersByRole(1);
res.Code.ShouldBeGreaterThan(0);
}
}
it thrwos exeption when trying to resolve _abpWebApiClient:
“Can not register IAbpWebApiClient. It should be a non-abstract class. If not, it should be registered before”
Please, any one can help my on how to resolve it?
Thank you, Khaled
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
'T' must be a non-abstract type with a public parameterless ...
While mapping class i am getting error 'T' must be a non-abstract type with a public parameterless constructor in order to use it...
Read more >When not to use an abstract super class?
YES, there are cases when the super class should not be abstract. ... but it is also a non-abstract super class for the...
Read more >Advanced Topics — class-registry documentation
Any non-abstract subclass that extends that base class will be registered ... However, the Pokemon base class was not added, because it is...
Read more >C# | Abstract Classes
In C#, an abstract class is a class that cannot be instantiated. Instead, it serves as a base class for other classes to...
Read more >A Deep Dive into C# Abstract Class
An abstract class can have a set of abstract and non-abstract methods. We should remember that the abstract class cannot be instantiated.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kgamalseif Thank you brother
@kgamalseif , Use same name for Interface and Service name. (E.g. Interface’s name is IPersonAppService, Service name must be PersonAppService.