question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not register IAbpWebApiClient. It should be a non-abstract class. If not, it should be registered before

See original GitHub issue

Hi,

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:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
KazziAzzimcommented, May 21, 2020

@kgamalseif Thank you brother

1reaction
MyoKoKoZawcommented, May 7, 2018

@kgamalseif , Use same name for Interface and Service name. (E.g. Interface’s name is IPersonAppService, Service name must be PersonAppService.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found