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 objectServiceThe 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?