Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

bUnit - Cannot provide a value for property "objectService" on type "directory" There is no registered service of type "IobjectService"

$
0
0

I'm attempting to unit test Blazor components for UI based things (when this button is pressed, these input fields should be displayed, etc). This is how my test is constructed:

[Test]public void TestPageRendering(){    using var ctx = new Bunit.TestContext();    ctx.Services.AddScoped<ObjService>();    var cut = ctx.RenderComponent<componentToTest>();    cut.Markup.Contains("blah blah");}

The @inject statement at the top of the componentToTest is as follows:

@inject IobjectService objectService

The error I receive is: Cannot provide a value for property "objectService" on type "directory" There is no registered service of type "IobjectService"

I assume there's an issue with a naming convention? Can't put my finger on it?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>