From 8d1246f45f12c3dfa26ce4f4efe466694ca957cd Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 21 Aug 2019 15:37:44 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=20Lock=20Post=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SQLServer/AccountTest.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/UnitTest/Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs b/UnitTest/Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs index 3a9e2be9..9ad8033e 100644 --- a/UnitTest/Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs +++ b/UnitTest/Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs @@ -91,8 +91,19 @@ namespace Bootstrap.Admin.Controllers.SqlServer var content = await r.Content.ReadAsStringAsync(); Assert.Contains("系统锁屏", content); - // relogin - await Client.LoginAsync(); + // 第二次调用 跳转到登录页面 + r = await Client.GetAsync("Lock"); + Assert.True(r.IsSuccessStatusCode); + content = await r.Content.ReadAsStringAsync(); + Assert.Contains("登 录", content); + + // 调用Post + var data = new MultipartFormDataContent + { + { new StringContent("Admin"), "userName" }, + { new StringContent("123789"), "password" } + }; + await Client.PostAsync("Lock", data); } } }