Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Can't perform a new Unit Test Code #9275


User avatar
0
collexe created

Deat support team,

I am writing a new unit test code on the platform, however, hitting the below issue saying Service 'Microsoft.AspNetCore.Hosting.IWebHostEnvironment' which was not registered,

below is the screenshot,

Kindly advise further and appreciate for the prompt response, thank you.

Regards Alvin T


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    You can do Mock IWebHostEnvironment in unit tests

    see https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4186