Skip to content

Is this a problem on Bunit or my project? #1336

Answered by linkdotnet
carbonell asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @carbonell,

Your problem is somewhat unrelated to bUnit itself. It is more or less a combination of Blazor and AutoMocker. Since .net8, the Renderer does the following:

ServiceProviderCascadingValueSuppliers = serviceProvider.GetService<ICascadingValueSupplier>() is null
        ? Array.Empty<ICascadingValueSupplier>()
        : serviceProvider.GetServices<ICascadingValueSupplier>().ToArray();

You can see this in your StackTrace that the c'tor of Bunits renderer ( WebTestRenderer that inherits from the Blazor Renderer) is throwing the exception. This comes as AutoMocker tries to create a fake for ICascadingValueSupplier. And as it can't create an instance of that internal interface - …

Replies: 1 comment 1 reply

Comment options

linkdotnet
Jan 5, 2024
Maintainer Sponsor

You must be logged in to vote
1 reply
@carbonell
Comment options

Answer selected by carbonell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants