From c89d589f31933f8115b78815a36f108b73983570 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 29 Sep 2019 13:12:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Admin/Controllers/SQLServer/HealthCheck.cs | 2 +- test/UnitTest/UnitTest.csproj | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/UnitTest/Bootstrap.Admin/Controllers/SQLServer/HealthCheck.cs b/test/UnitTest/Bootstrap.Admin/Controllers/SQLServer/HealthCheck.cs index 4a5ecccf..68c721f8 100644 --- a/test/UnitTest/Bootstrap.Admin/Controllers/SQLServer/HealthCheck.cs +++ b/test/UnitTest/Bootstrap.Admin/Controllers/SQLServer/HealthCheck.cs @@ -1,6 +1,6 @@ using Xunit; -namespace Bootstrap.Admin.Controllers.SQLServer +namespace Bootstrap.Admin.Controllers.SqlServer { public class HealthCheck : ControllerTest { diff --git a/test/UnitTest/UnitTest.csproj b/test/UnitTest/UnitTest.csproj index 1503e27f..05a83bf1 100644 --- a/test/UnitTest/UnitTest.csproj +++ b/test/UnitTest/UnitTest.csproj @@ -9,7 +9,11 @@ all - runtime; build; native; contentfiles; analyzers + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive From c00c04c5615b71d3941735031b5539b9518ce486 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 29 Sep 2019 15:14:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=20build=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=A4=8D=E5=88=B6=E6=96=87=E4=BB=B6=E5=88=B0?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/Directory.Build.props | 15 +++++++++++++++ test/UnitTest/DB/UnitTest.db | Bin 94208 -> 0 bytes test/UnitTest/TestHelper.cs | 4 ---- test/UnitTest/appsettings.json | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 test/Directory.Build.props delete mode 100644 test/UnitTest/DB/UnitTest.db diff --git a/test/Directory.Build.props b/test/Directory.Build.props new file mode 100644 index 00000000..381f48af --- /dev/null +++ b/test/Directory.Build.props @@ -0,0 +1,15 @@ + + + + true + + + + + + + + + + + diff --git a/test/UnitTest/DB/UnitTest.db b/test/UnitTest/DB/UnitTest.db deleted file mode 100644 index 034052bc3ed62969bfc620d599f5e431a20edd59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 94208 zcmeI5dvF^^df)+wgBMARD2awCi6&^85@|j#0N;`*nJ-s#aawo+8lT^!Igt-><*!8O#j2w`}eS#01A^I6BV99CfVci*Pvry(9_#CxWn;M*N$q)LNa~)xUkEywQaDYyKT@> z(ZF$)j=ugON8fNykE5f%rw0|;*Wb~$r3f@;XIK=XkJkX_%*esRyKE+V zaj||XAN$uUh$8P7L?vZ4UMhRRQBSACVzFfQbSMxD3XrXGGi5Qj)e#QGgiy?(7Ep0O zj&F>H$9FAI#LGkBg|fE@A>UA79E|7$phKQs1eH*R(znF;*o3%1=^KN*AF{zaM`zc@ zw&9*3M+H|2njW!J2nrCZ8S;Ag5g|CQP;2F6Z$6Hn!v`_n&VV;2;y0UyEZ+4PtQ~wz z@Q0%ZHQY2{QM1ppK<#%&*r&;MbL#K|_d12qKnRH-&lO-P1g=VJ<>6qS$zEEjpDM%t zbRF;tkys!c5>ub@HJ+vRC*8{uHf@neXLy_s;CRpOWLGpAjt)SOF5oHZ10+JVF$ld3 z+{C#NP)`M*s{ufg+@!%n2P06&P}lYp3s9E(0BFz8fw1z94Mlk`vW#Ss5_`ga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Q#Pm^)bNzp%iaw

app.AddInMemoryCollection(new KeyValuePair[] { new KeyValuePair("DB:0:Enabled", "false"), new KeyValuePair("DB:1:Enabled", "true") diff --git a/test/UnitTest/appsettings.json b/test/UnitTest/appsettings.json index f00519b3..084fb0fd 100644 --- a/test/UnitTest/appsettings.json +++ b/test/UnitTest/appsettings.json @@ -24,7 +24,7 @@ "Enabled": false, "ProviderName": "Sqlite", "ConnectionStrings": { - "ba": "Data Source=UnitTest.db;" + "ba": "Data Source=BootstrapAdmin.db;" } }, { From 7abb4acbcb5c6429e5802e6102eff05a74b770db Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 29 Sep 2019 15:17:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?test:=20=E5=81=A5=E5=BA=B7=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=9B=B4=E6=94=B9=E4=B8=BA=20NETCore=203.0=20?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Admin/Api/HealthCheckTest.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/UnitTest/Bootstrap.Admin/Api/HealthCheckTest.cs b/test/UnitTest/Bootstrap.Admin/Api/HealthCheckTest.cs index eeca537a..972c93ca 100644 --- a/test/UnitTest/Bootstrap.Admin/Api/HealthCheckTest.cs +++ b/test/UnitTest/Bootstrap.Admin/Api/HealthCheckTest.cs @@ -1,5 +1,4 @@ using Bootstrap.Admin.HealthChecks; -using Microsoft.AspNetCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Hosting; @@ -8,8 +7,8 @@ using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; using Newtonsoft.Json; -using System.IO; using System.Net.Http; using UnitTest; using Xunit; @@ -88,18 +87,19 @@ namespace Bootstrap.Admin.Api services.AddDbAdapter(); var builder = services.AddHealthChecks(); builder.AddCheck("db"); - services.AddMvcCore(); + services.AddControllers(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + public void Configure(IApplicationBuilder app) { + app.UseRouting(); app.Use(async (context, next) => { context.User = new System.Security.Claims.ClaimsPrincipal(new System.Security.Principal.GenericIdentity("Argo")); await next(); }); - app.UseHealthChecks("/Healths", new HealthCheckOptions() + app.UseEndpoints(builder => builder.MapHealthChecks("/Healths", new HealthCheckOptions() { ResponseWriter = (context, report) => { @@ -112,8 +112,7 @@ namespace Bootstrap.Admin.Api [HealthStatus.Degraded] = StatusCodes.Status200OK, [HealthStatus.Unhealthy] = StatusCodes.Status200OK } - }); - app.UseMvcWithDefaultRoute(); + })); } } @@ -132,6 +131,6 @@ namespace Bootstrap.Admin.Api /// /// /// - protected override IWebHostBuilder CreateWebHostBuilder() => WebHost.CreateDefaultBuilder(null); + protected override IHostBuilder CreateHostBuilder() => Host.CreateDefaultBuilder().ConfigureWebHostDefaults(builder => builder.UseStartup()); } }