diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0236ff5bb..982ac6f3e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -30,3 +30,14 @@ jobs:
run: |
dotnet restore src/BootstrapBlazor --no-cache
dotnet build src/BootstrapBlazor
+
+ - name: Test
+ run: |
+ dotnet test test/UnitTest -c Release -f net6.0 --collect:"XPlat Code Coverage" -r ./coverage
+ #dotnet test test/UnitTest.Localization -c Release -f net6.0 --collect:"XPlat Code Coverage" -r ./coverage
+
+ - name: Upload to Codecov
+ uses: codecov/codecov-action@v2
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ directory: ./coverage/
diff --git a/BootstrapBlazor.sln b/BootstrapBlazor.sln
index 51c3878a1..ca982e0e1 100644
--- a/BootstrapBlazor.sln
+++ b/BootstrapBlazor.sln
@@ -113,7 +113,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "middleware", "middleware",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapBlazor.Middleware", "src\Middleware\BootstrapBlazor.Middleware\BootstrapBlazor.Middleware.csproj", "{59B49D4C-05FB-4E51-AB40-9498ADC71DD0}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest.Localization", "test\UnitTest.Localization\UnitTest.Localization.csproj", "{99B55645-0E89-43F8-938F-2304B486AD2A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest.Localization", "test\UnitTest.Localization\UnitTest.Localization.csproj", "{99B55645-0E89-43F8-938F-2304B486AD2A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/README.md b/README.md
index 002885933..deb9cf96f 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
[![Github](https://img.shields.io/github/license/argozhang/bootstrapblazor.svg?logo=git&logoColor=red)](https://github.com/ArgoZhang/BootstrapBlazor/blob/main/LICENSE)
[![Repo Size](https://img.shields.io/github/repo-size/ArgoZhang/BootstrapBlazor.svg?logo=github&logoColor=green&label=repo)](https://github.com/ArgoZhang/BootstrapBlazor)
[![Commit Date](https://img.shields.io/github/last-commit/ArgoZhang/BootstrapBlazor/main.svg?logo=github&logoColor=green&label=commit)](https://github.com/ArgoZhang/BootstrapBlazor)
-
+[![codecov](https://codecov.io/gh/dotnetcore/BootstrapBlazor/branch/master/graph/badge.svg?token=5SXIWHXZC3)](https://codecov.io/gh/dotnetcore/BootstrapBlazor)
---
diff --git a/README.zh-CN.md b/README.zh-CN.md
index cfad09fd7..db77e3e23 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -9,9 +9,8 @@
[![Github](https://img.shields.io/github/license/argozhang/bootstrapblazor.svg?logo=git&logoColor=red)](https://github.com/ArgoZhang/BootstrapBlazor/blob/main/LICENSE)
[![Repo Size](https://img.shields.io/github/repo-size/ArgoZhang/BootstrapBlazor.svg?logo=github&logoColor=green&label=repo)](https://github.com/ArgoZhang/BootstrapBlazor)
[![Commit Date](https://img.shields.io/github/last-commit/ArgoZhang/BootstrapBlazor/main.svg?logo=github&logoColor=green&label=commit)](https://github.com/ArgoZhang/BootstrapBlazor)
-
+[![codecov](https://codecov.io/gh/dotnetcore/BootstrapBlazor/branch/master/graph/badge.svg?token=5SXIWHXZC3)](https://codecov.io/gh/dotnetcore/BootstrapBlazor)
-
---
English | 中文
diff --git a/test/UnitTest.Localization/BootstrapBlazorZhTestBase .cs b/test/UnitTest.Localization/BootstrapBlazorZhTestBase .cs
index 948a7a291..fcf8c3c04 100644
--- a/test/UnitTest.Localization/BootstrapBlazorZhTestBase .cs
+++ b/test/UnitTest.Localization/BootstrapBlazorZhTestBase .cs
@@ -34,7 +34,7 @@ namespace UnitTest.Localization
services.AddLocalization(option => option.ResourcesPath = "Resources");
services.AddBootstrapBlazor(localizationAction: options =>
{
- options.ResourceManagerStringLocalizerType = typeof(BootstrapBlazorEnTestHost);
+ options.ResourceManagerStringLocalizerType = typeof(BootstrapBlazorZhTestHost);
});
}
diff --git a/test/UnitTest.Localization/Resources/BootstrapBlazorEnTestHost.zh-CN.resx b/test/UnitTest.Localization/Resources/BootstrapBlazorZhTestHost.zh-CN.resx
similarity index 100%
rename from test/UnitTest.Localization/Resources/BootstrapBlazorEnTestHost.zh-CN.resx
rename to test/UnitTest.Localization/Resources/BootstrapBlazorZhTestHost.zh-CN.resx
diff --git a/test/UnitTest/Core/BootstrapBlazorTestBase.cs b/test/UnitTest/Core/BootstrapBlazorTestBase.cs
index 69b2b658f..98c097b60 100644
--- a/test/UnitTest/Core/BootstrapBlazorTestBase.cs
+++ b/test/UnitTest/Core/BootstrapBlazorTestBase.cs
@@ -45,7 +45,7 @@ namespace UnitTest.Core
ConfigureConfigration(Instance.Services);
// 渲染 BootstrapBlazorRoot 组件 激活 ICacheManager 接口
- Instance.RenderTree.Add();
+ Instance.Services.GetRequiredService();
}
protected virtual void ConfigureServices(IServiceCollection services)