From a5c029e2aa191073c88cb6337cbc30ca7ae1f0cc Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 15 Mar 2019 18:59:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E9=99=90=E5=88=B6=E9=9D=9E?= =?UTF-8?q?=E6=B3=95=E5=AD=97=E7=AC=A6=E6=96=B9=E6=B3=95=E7=9A=84=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95=20link=20#ITL7E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Issue https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues/ITL7E --- UnitTest/Bootstrap.Admin/Api/RegisterTest.cs | 3 +-- UnitTest/Bootstrap.Admin/Api/UsersTest.cs | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs b/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs index 5adb6178..8ba32958 100644 --- a/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs @@ -19,10 +19,9 @@ namespace Bootstrap.Admin.Api public async void Post_Ok() { // register new user - var nusr = new User() { UserName = "UnitTest-RegisterController", DisplayName = "UnitTest", Password = "1", Description = "UnitTest" }; + var nusr = new User() { UserName = "UnitTest_RegisterController", DisplayName = "UnitTest", Password = "1", Description = "UnitTest" }; var resp = await Client.PostAsJsonAsync(nusr); Assert.True(resp); - nusr.Delete(nusr.RetrieveNewUsers().Where(u => u.UserName == nusr.UserName).Select(u => u.Id)); } diff --git a/UnitTest/Bootstrap.Admin/Api/UsersTest.cs b/UnitTest/Bootstrap.Admin/Api/UsersTest.cs index 4fa39932..1666c559 100644 --- a/UnitTest/Bootstrap.Admin/Api/UsersTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/UsersTest.cs @@ -36,7 +36,7 @@ namespace Bootstrap.Admin.Api var user = new User(); user.Delete(user.Retrieves().Where(usr => usr.UserName == "UnitTest-Delete").Select(usr => usr.Id)); - var nusr = new User { UserName = "UnitTest-Delete", Password = "1", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" }; + var nusr = new User { UserName = "UnitTest_Delete", Password = "1", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" }; var resp = await Client.PostAsJsonAsync("", nusr); Assert.True(resp); @@ -80,7 +80,7 @@ namespace Bootstrap.Admin.Api [Fact] public async void Put_Ok() { - var usr = new User { UserName = "UnitTest-Change", Password = "1", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" }; + var usr = new User { UserName = "UnitTest_Change", Password = "1", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" }; usr.Delete(usr.Retrieves().Where(u => u.UserName == usr.UserName).Select(u => u.Id)); Assert.True(usr.Save(usr)); @@ -97,7 +97,7 @@ namespace Bootstrap.Admin.Api // Login as new user var client = Host.CreateClient(); client.BaseAddress = new Uri("http://localhost/api/Users"); - await client.LoginAsync("UnitTest-Change", "1"); + await client.LoginAsync("UnitTest_Change", "1"); resp = await client.PutAsJsonAsync(usr); Assert.True(resp);