Message: The following constructor Parameters Did not have matching fixture data: Icompetitionservice competitionManager

Asked

Viewed 382 times

0

I am getting the following error in my application Xunit, when using dependency injection:

Message: The following constructor Parameters Did not have matching fixture data:Icompetitionservice competitionManager

My builder where I create the injection:

 private readonly CampeonatosController _campeonato;

    private readonly ICompetitionService _competitionManager;

    public CampeonatoTest(
        ICompetitionService competitionManager)
    {
        _competitionManager = competitionManager;

        _campeonato = new CampeonatosController(_competitionManager);
    }
  • this code does not say much, need to see where you registered the dependency of ICompetitionService, if it is a class that actually implements the interface

  • Yes this is correct, it implements correctly.

  • So can you put your test code in here? as I said, this code doesn’t say much, you need to see the code that makes the injection and the test, if the mock is correct

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.