From 75d4e529bd4e94ce7cf5bc5979277bb6881cea63 Mon Sep 17 00:00:00 2001 From: Argo-Surface Date: Wed, 16 Jan 2019 13:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0LoginController=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UnitTest/Bootstrap.Admin/Api/LoginTest.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/UnitTest/Bootstrap.Admin/Api/LoginTest.cs b/UnitTest/Bootstrap.Admin/Api/LoginTest.cs index 2e22e953..38dabf7e 100644 --- a/UnitTest/Bootstrap.Admin/Api/LoginTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/LoginTest.cs @@ -3,21 +3,26 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class LoginTest : IClassFixture + public class LoginTest : ApiTest { - private HttpClient _client; - - public LoginTest(BAWebHost factory) + public LoginTest(BAWebHost factory) : base(factory, "Login", false) { - _client = factory.CreateClient(); + } [Fact] public async void Login_Ok() { - var resq = await _client.PostAsJsonAsync("/api/Login", new { userName = "Admin", password = "123789" }); + var resq = await Client.PostAsJsonAsync("", new { userName = "Admin", password = "123789" }); var _token = await resq.Content.ReadAsStringAsync(); Assert.NotNull(_token); } + + [Fact] + public async void Option_Ok() + { + var req = new HttpRequestMessage(HttpMethod.Options, ""); + var resp = await Client.SendAsync(req); + } } }