diff --git a/BlazorToolkit.sln b/BlazorToolkit.sln new file mode 100644 index 0000000..aac37a1 --- /dev/null +++ b/BlazorToolkit.sln @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AstroPanda.Blazor.Toolkit", "src\AstroPanda.Blazor.Toolkit.csproj", "{30E1015A-A3BB-4FDA-BB5D-3D1054E9196A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{04E1DA45-4FDB-4ACE-B236-8FA4C8F5FAEE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AstroPanda.Blazor.Toolkit.Test", "test\AstroPanda.Blazor.Toolkit.Test\AstroPanda.Blazor.Toolkit.Test\AstroPanda.Blazor.Toolkit.Test.csproj", "{FCB43029-3141-45C0-9E11-BC045C8538DE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {30E1015A-A3BB-4FDA-BB5D-3D1054E9196A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {30E1015A-A3BB-4FDA-BB5D-3D1054E9196A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {30E1015A-A3BB-4FDA-BB5D-3D1054E9196A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {30E1015A-A3BB-4FDA-BB5D-3D1054E9196A}.Release|Any CPU.Build.0 = Release|Any CPU + {FCB43029-3141-45C0-9E11-BC045C8538DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCB43029-3141-45C0-9E11-BC045C8538DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCB43029-3141-45C0-9E11-BC045C8538DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCB43029-3141-45C0-9E11-BC045C8538DE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {FCB43029-3141-45C0-9E11-BC045C8538DE} = {04E1DA45-4FDB-4ACE-B236-8FA4C8F5FAEE} + EndGlobalSection +EndGlobal diff --git a/src/Components/PrintableArea.razor b/src/Components/PrintableArea.razor index 176b6ae..4e1af6d 100644 --- a/src/Components/PrintableArea.razor +++ b/src/Components/PrintableArea.razor @@ -1,6 +1,6 @@ @namespace AstroPanda.Blazor.Toolkit -@using AstroPanda.Blazor.Toolkit.Services +@using AstroPanda.Blazor.Toolkit
@ChildContent diff --git a/src/Extensions/ServiceCollectionExtensions.cs b/src/Extensions/ServiceCollectionExtensions.cs index b9bf12f..a77fbdd 100644 --- a/src/Extensions/ServiceCollectionExtensions.cs +++ b/src/Extensions/ServiceCollectionExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using AstroPanda.Blazor.Toolkit.Services; +using AstroPanda.Blazor.Toolkit; namespace AstroPanda.Blazor.Toolkit; public static class ServiceCollectionExtensions diff --git a/src/Services/IPrintService.cs b/src/Services/IPrintService.cs index c707b0e..de82287 100644 --- a/src/Services/IPrintService.cs +++ b/src/Services/IPrintService.cs @@ -1,7 +1,4 @@ -using Microsoft.AspNetCore.Components; -using System.Threading.Tasks; - -namespace AstroPanda.Blazor.Toolkit.Services; +namespace AstroPanda.Blazor.Toolkit; public interface IPrintService { diff --git a/src/Services/PrintService.cs b/src/Services/PrintService.cs index 9564b29..076d2d4 100644 --- a/src/Services/PrintService.cs +++ b/src/Services/PrintService.cs @@ -1,9 +1,6 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.JSInterop; -using System; -using System.Threading.Tasks; +using Microsoft.JSInterop; -namespace AstroPanda.Blazor.Toolkit.Services +namespace AstroPanda.Blazor.Toolkit { public class PrintService : IPrintService, IAsyncDisposable { diff --git a/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test.csproj b/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test.csproj new file mode 100644 index 0000000..5435ca4 --- /dev/null +++ b/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test.csproj @@ -0,0 +1,39 @@ + + + + net7.0 + enable + false + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + diff --git a/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/ServiceCollectionExtensionsTests.cs b/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/ServiceCollectionExtensionsTests.cs new file mode 100644 index 0000000..8cfdb35 --- /dev/null +++ b/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/ServiceCollectionExtensionsTests.cs @@ -0,0 +1,16 @@ +namespace AstroPanda.Blazor.Toolkit.Test; + +public class ServiceCollectionExtensionsTests : TestContext +{ + + [Fact] + public void AddBlazorToolkit_Adds_All_Services_To_ServiceCollection() + { + // Act + Services.AddBlazorToolkit(); + + // Assert + Assert.NotNull(Services.GetService()); + Assert.NotNull(Services.GetService()); + } +} diff --git a/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/_Imports.razor b/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/_Imports.razor new file mode 100644 index 0000000..5703c20 --- /dev/null +++ b/test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test/_Imports.razor @@ -0,0 +1,6 @@ +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.JSInterop +@using Microsoft.Extensions.DependencyInjection +@using Bunit +@using Bunit.TestDoubles +@using Xunit