Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="RavenDB.TestDriver" Version="7.0.3" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="bunit" Version="2.0.24-preview" />
<PackageVersion Include="bunit.generators" Version="2.0.24-preview" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<PackageVersion Include="bunit" Version="2.0.41-preview" />
<PackageVersion Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
1 change: 0 additions & 1 deletion tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="bunit.generators" />
<PackageReference Include="bunit" />
<PackageReference Include="Shouldly" />
<PackageReference Include="NSubstitute" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task ShouldSaveBlogPostOnSave()
instantRegistry.Received(1).RunInstantJob<SimilarBlogPostJob>(Arg.Any<object>(), Arg.Any<CancellationToken>());
}

private static void TriggerNewBlogPost(RenderedComponent<CreateNewBlogPost> cut)
private static void TriggerNewBlogPost(IRenderedComponent<CreateNewBlogPost> cut)
{
cut.Find("#title").Input("My Title");
cut.Find("#short").Input("My short Description");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using LinkDotNet.Blog.Web.Features.Admin.BlogPostEditor.Components;
using LinkDotNet.Blog.Web.Features.Components;
using LinkDotNet.Blog.Web.Features.Services;
using Microsoft.AspNetCore.Components;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using NCronJob;
Expand Down Expand Up @@ -68,7 +69,7 @@ public void ShouldThrowWhenNoIdProvided()
act.ShouldThrow<ArgumentNullException>();
}

private static void TriggerUpdate(RenderedFragment cut)
private static void TriggerUpdate(IRenderedComponent<IComponent> cut)
{
cut.Find("#short").Input("My new Description");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ private static void SetupGetAll(
return (repoMock, calcMock);
}

private RenderedComponent<Profile> RenderProfileWithEmptyInformation()
private IRenderedComponent<Profile> RenderProfileWithEmptyInformation()
=> Render<Profile>(p => p.Add(s => s.ProfileInformation, new ProfileInformationBuilder().Build()));

private RenderedComponent<Profile> RenderProfileInAdmin()
private IRenderedComponent<Profile> RenderProfileInAdmin()
=> Render<Profile>(p => p
.Add(s => s.ProfileInformation, new ProfileInformationBuilder().Build())
.Add(s => s.ShowAdminActions, true));
Expand Down
4 changes: 2 additions & 2 deletions tests/LinkDotNet.Blog.TestUtilities/BunitExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace LinkDotNet.Blog.TestUtilities;

public static class BunitExtensions
{
public static RenderedComponent<TComponent> WaitForComponent<TComponent>(this RenderedFragment component)
public static IRenderedComponent<TComponent> WaitForComponent<TComponent>(this IRenderedComponent<IComponent> component)
where TComponent : IComponent
{
component.WaitForState(component.HasComponent<TComponent>);
return component.FindComponent<TComponent>();
}

public static IReadOnlyList<RenderedComponent<TComponent>> WaitForComponents<TComponent>(this RenderedFragment component)
public static IReadOnlyList<IRenderedComponent<TComponent>> WaitForComponents<TComponent>(this IRenderedComponent<IComponent> component)
where TComponent : IComponent
{
component.WaitForState(component.HasComponent<TComponent>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void ShouldSetCanoncialLinkWithoutQueryParameter()
}

private static void AssertMetaTagExistsWithValue(
RenderedFragment cut,
IRenderedComponent<IComponent> cut,
string metaTag,
string metaTagValue,
string? ogPropertyName = null)
Expand All @@ -87,7 +87,7 @@ private static void AssertMetaTagExistsWithValue(
}

private static bool GetMetaTagExists(
RenderedFragment cut,
IRenderedComponent<IComponent> cut,
string metaTag)
{
var metaTags = cut.FindAll("meta");
Expand Down