Skip to content

fix: New up renderer for markup matches#1160

Merged
linkdotnet merged 3 commits intomainfrom
fix/fragment-container
Jul 23, 2023
Merged

fix: New up renderer for markup matches#1160
linkdotnet merged 3 commits intomainfrom
fix/fragment-container

Conversation

@linkdotnet
Copy link
Copy Markdown
Collaborator

Newing up a renderer for MarkupMatches to prevent being deadlocked to renderer the expected RenderFragment.

@linkdotnet linkdotnet requested a review from egil July 19, 2023 08:56
@linkdotnet linkdotnet force-pushed the fix/fragment-container branch from 65144e7 to 2e1468f Compare July 19, 2023 08:56
Comment thread tests/.editorconfig Outdated
Comment thread src/bunit.web/Asserting/MarkupMatchesAssertExtensions.cs
@linkdotnet linkdotnet force-pushed the fix/fragment-container branch from db8f87e to 784749d Compare July 23, 2023 13:29
@linkdotnet linkdotnet requested a review from egil July 23, 2023 13:30
@linkdotnet linkdotnet merged commit 76fd92f into main Jul 23, 2023
@linkdotnet linkdotnet deleted the fix/fragment-container branch July 23, 2023 18:05
using var renderer = new TestRenderer(
actual.Services.GetRequiredService<IRenderedComponentActivator>(),
actual.Services.GetRequiredService<TestServiceProvider>(),
actual.Services.GetRequiredService<ILoggerFactory>());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI you can use ActivatorUtilities.CreateInstance to create a new instance while automatically supplying existing services. Makes it less brittle if new services are needed in the future, too.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting one. I would still prefer the explicit new but a nice addition in any case.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants