diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index e8ebf51f1..bd0cf29b3 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -60,10 +60,10 @@ jobs: with: path: ./CHANGELOG.md - - name: 🛠️ Update tokens in project files + - name: 🛠️ Update tokens in files uses: cschleiden/replace-tokens@v1 with: - files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]' + files: '["docs/site/*.md", "docs/**/*.md", "docs/**/docfx.json", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]' env: RELEASE_VERSION: ${{ steps.changelog_reader.outputs.version }} RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }} diff --git a/src/bunit.generators/bunit.generators.csproj b/src/bunit.generators/bunit.generators.csproj index b7f7c14b4..35db4af3c 100644 --- a/src/bunit.generators/bunit.generators.csproj +++ b/src/bunit.generators/bunit.generators.csproj @@ -70,7 +70,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/bunit.template/template/Company.BlazorTests1.csproj b/src/bunit.template/template/Company.BlazorTests1.csproj index cddc2d51c..2801d2147 100644 --- a/src/bunit.template/template/Company.BlazorTests1.csproj +++ b/src/bunit.template/template/Company.BlazorTests1.csproj @@ -17,7 +17,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index cf39b2404..b1a3039cd 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -25,7 +25,7 @@ - + diff --git a/tests/bunit.generators.tests/bunit.generators.tests.csproj b/tests/bunit.generators.tests/bunit.generators.tests.csproj index ff5b9bf20..4ec1f4acd 100644 --- a/tests/bunit.generators.tests/bunit.generators.tests.csproj +++ b/tests/bunit.generators.tests/bunit.generators.tests.csproj @@ -13,11 +13,10 @@ - + - - + diff --git a/tests/bunit.web.tests/JSInterop/InvocationHandlers/VirtualizeJSRuntimeInvocationHandlerTest.cs b/tests/bunit.web.tests/JSInterop/InvocationHandlers/VirtualizeJSRuntimeInvocationHandlerTest.cs index 7df771ecb..4ca33d9c9 100644 --- a/tests/bunit.web.tests/JSInterop/InvocationHandlers/VirtualizeJSRuntimeInvocationHandlerTest.cs +++ b/tests/bunit.web.tests/JSInterop/InvocationHandlers/VirtualizeJSRuntimeInvocationHandlerTest.cs @@ -11,9 +11,9 @@ namespace Bunit.JSInterop.ComponentSupport; public class VirtualizeJSRuntimeInvocationHandlerTest : TestContext { - public static readonly IEnumerable ItemsInCollection = new object[][] + public static readonly TheoryData ItemsInCollection = new() { - new object[] { 0 }, new object[] { 7 }, new object[] { 30 }, new object[] { 60 }, new object[] { 100 }, new object[] { 300 }, new object[] { 500 }, + 0, 7, 30, 60, 100, 300, 500, }; [Theory(DisplayName = "Can render component using with ChildContent")] @@ -22,6 +22,9 @@ public void Test001(int itemsInDataSource) { var cut = RenderComponent>(ps => ps .Add(p => p.Items, CreateItems(itemsInDataSource)) +#if NET9_0_OR_GREATER + .Add(p => p.MaxItemCount, itemsInDataSource) +#endif .Add(p => p.ChildContent, item => $"

{item}

")); cut.FindAll("p").Count.ShouldBe(itemsInDataSource); @@ -33,6 +36,9 @@ public void Test002(int itemsInDataSource) { var cut = RenderComponent>(ps => ps .Add(p => p.Items, CreateItems(itemsInDataSource)) +#if NET9_0_OR_GREATER + .Add(p => p.MaxItemCount, itemsInDataSource) +#endif .Add(p => p.ItemContent, item => $"

{item}

")); cut.FindAll("p").Count.ShouldBe(itemsInDataSource); @@ -44,6 +50,9 @@ public void Test010(int itemsInDataSource) { var cut = RenderComponent>(ps => ps .Add(p => p.ItemsProvider, CreateItemsProvider(itemsInDataSource)) +#if NET9_0_OR_GREATER + .Add(p => p.MaxItemCount, itemsInDataSource) +#endif .Add(p => p.ChildContent, item => $"

{item}

")); cut.FindAll("p").Count.ShouldBe(itemsInDataSource); @@ -55,21 +64,59 @@ public void Test011(int itemsInDataSource) { var cut = RenderComponent>(ps => ps .Add(p => p.ItemsProvider, CreateItemsProvider(itemsInDataSource)) +#if NET9_0_OR_GREATER + .Add(p => p.MaxItemCount, itemsInDataSource) +#endif .Add(p => p.ItemContent, item => $"

{item}

")); cut.FindAll("p").Count.ShouldBe(itemsInDataSource); } - public static readonly IEnumerable ItemCountItemSizeOverscanCount = - ItemsInCollection.Select(x => new object[][] - { - new object[] { x[0], 1, 3 }, - new object[] { x[0], 1_000_000, 3 }, - new object[] { x[0], 50, 1 }, - new object[] { x[0], 50, 1_000_000 }, - new object[] { x[0], 1, 1 }, - new object[] { x[0], 1_000_000, 1_000_000 }, - }).SelectMany(x => x); + public static readonly TheoryData ItemCountItemSizeOverscanCount = new() + { + { 0, 1, 3 }, + { 0, 1_000_000, 3 }, + { 0, 50, 1 }, + { 0, 50, 1_000_000 }, + { 0, 1, 1 }, + { 0, 1_000_000, 1_000_000 }, + { 7, 1, 3 }, + { 7, 1_000_000, 3 }, + { 7, 50, 1 }, + { 7, 50, 1_000_000 }, + { 7, 1, 1 }, + { 7, 1_000_000, 1_000_000 }, + { 30, 1, 3 }, + { 30, 1_000_000, 3 }, + { 30, 50, 1 }, + { 30, 50, 1_000_000 }, + { 30, 1, 1 }, + { 30, 1_000_000, 1_000_000 }, + { 60, 1, 3 }, + { 60, 1_000_000, 3 }, + { 60, 50, 1 }, + { 60, 50, 1_000_000 }, + { 60, 1, 1 }, + { 60, 1_000_000, 1_000_000 }, + { 100, 1, 3 }, + { 100, 1_000_000, 3 }, + { 100, 50, 1 }, + { 100, 50, 1_000_000 }, + { 100, 1, 1 }, + { 100, 1_000_000, 1_000_000 }, + { 300, 1, 3 }, + { 300, 1_000_000, 3 }, + { 300, 50, 1 }, + { 300, 50, 1_000_000 }, + { 300, 1, 1 }, + { 300, 1_000_000, 1_000_000 }, + { 500, 1, 3 }, + { 500, 1_000_000, 3 }, + { 500, 50, 1 }, + { 500, 50, 1_000_000 }, + { 500, 1, 1 }, + { 500, 1_000_000, 1_000_000 } + }; [Theory(DisplayName = "Can render component using and different ItemSize and OverscanCount")] [MemberData(nameof(ItemCountItemSizeOverscanCount))] @@ -79,6 +126,9 @@ public void Test030(int itemsInDataSource, float itemSize, int overscanCount) .Add(p => p.ItemsProvider, CreateItemsProvider(itemsInDataSource)) .Add(p => p.ItemContent, item => $"

{item}

") .Add(p => p.ItemSize, itemSize) +#if NET9_0_OR_GREATER + .Add(p => p.MaxItemCount, itemsInDataSource) +#endif .Add(p => p.OverscanCount, overscanCount)); cut.FindAll("p").Count.ShouldBe(itemsInDataSource); @@ -91,6 +141,9 @@ public void Test040(int itemsInDataSource) var cut = RenderComponent>(ps => ps .Add(p => p.ItemsProvider, _ => ValueTask.FromResult(new ItemsProviderResult(Array.Empty(), itemsInDataSource))) .Add(p => p.ItemContent, item => @$"

{item}

") +#if NET9_0_OR_GREATER + .Add(p => p.MaxItemCount, itemsInDataSource) +#endif .Add(p => p.Placeholder, _ => @"

")); cut.FindAll(".placeholder").Count.ShouldBe(itemsInDataSource);