From edcfbeeebbea2d8ccd3d45acb38d9c1d00dfaea8 Mon Sep 17 00:00:00 2001 From: Argo-Surface Date: Wed, 16 Jan 2019 18:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=EF=BC=9A?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8DApiWebHost/ControllerWebHost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UnitTest/Bootstrap.Admin/Api/{ApiTest.cs => ApiWebHost.cs} | 4 ++-- UnitTest/Bootstrap.Admin/Api/CategoryTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/DictsTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/ExceptionsTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/GroupsTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/InterfaceTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/LoginTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/LogsTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/MenusTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/MessagesTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/NewTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/NotificationsTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/RegisterTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/RolesTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/SettingsTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/TasksTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/UsersTest.cs | 2 +- UnitTest/Bootstrap.Admin/Controllers/AccountTest.cs | 2 +- UnitTest/Bootstrap.Admin/Controllers/AdminTest.cs | 2 +- .../Controllers/{ControllerTest.cs => ControllerWebHost.cs} | 4 ++-- UnitTest/Bootstrap.Admin/Controllers/HomeTest.cs | 2 +- 21 files changed, 23 insertions(+), 23 deletions(-) rename UnitTest/Bootstrap.Admin/Api/{ApiTest.cs => ApiWebHost.cs} (74%) rename UnitTest/Bootstrap.Admin/Controllers/{ControllerTest.cs => ControllerWebHost.cs} (72%) diff --git a/UnitTest/Bootstrap.Admin/Api/ApiTest.cs b/UnitTest/Bootstrap.Admin/Api/ApiWebHost.cs similarity index 74% rename from UnitTest/Bootstrap.Admin/Api/ApiTest.cs rename to UnitTest/Bootstrap.Admin/Api/ApiWebHost.cs index 184c38eb..eef37940 100644 --- a/UnitTest/Bootstrap.Admin/Api/ApiTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/ApiWebHost.cs @@ -3,11 +3,11 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class ApiTest : IClassFixture + public class ApiWebHost : IClassFixture { protected HttpClient Client { get; } - public ApiTest(BAWebHost factory, string controller, bool login) + public ApiWebHost(BAWebHost factory, string controller, bool login) { factory.ClientOptions.BaseAddress = new System.Uri($"http://localhost/api/{controller}/"); Client = factory.CreateClient(); diff --git a/UnitTest/Bootstrap.Admin/Api/CategoryTest.cs b/UnitTest/Bootstrap.Admin/Api/CategoryTest.cs index a1e35651..c1de63d7 100644 --- a/UnitTest/Bootstrap.Admin/Api/CategoryTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/CategoryTest.cs @@ -3,7 +3,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class CategoryTest : ApiTest + public class CategoryTest : ApiWebHost { public CategoryTest(BAWebHost factory) : base(factory, "Category", false) { diff --git a/UnitTest/Bootstrap.Admin/Api/DictsTest.cs b/UnitTest/Bootstrap.Admin/Api/DictsTest.cs index b7277736..2c91be11 100644 --- a/UnitTest/Bootstrap.Admin/Api/DictsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/DictsTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class DictsTest : ApiTest + public class DictsTest : ApiWebHost { public DictsTest(BAWebHost factory) : base(factory, "Dicts", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/ExceptionsTest.cs b/UnitTest/Bootstrap.Admin/Api/ExceptionsTest.cs index 4735360a..98705bd4 100644 --- a/UnitTest/Bootstrap.Admin/Api/ExceptionsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/ExceptionsTest.cs @@ -8,7 +8,7 @@ using static Bootstrap.Admin.Controllers.Api.ExceptionsController; namespace Bootstrap.Admin.Api { - public class ExceptionsTest : ApiTest + public class ExceptionsTest : ApiWebHost { public ExceptionsTest(BAWebHost factory) : base(factory, "Exceptions", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/GroupsTest.cs b/UnitTest/Bootstrap.Admin/Api/GroupsTest.cs index 3b8bc538..c5c8231b 100644 --- a/UnitTest/Bootstrap.Admin/Api/GroupsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/GroupsTest.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace Bootstrap.Admin.Api { - public class GroupsTest : ApiTest + public class GroupsTest : ApiWebHost { public GroupsTest(BAWebHost factory) : base(factory, "Groups", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/InterfaceTest.cs b/UnitTest/Bootstrap.Admin/Api/InterfaceTest.cs index ba57d44a..9f0353cd 100644 --- a/UnitTest/Bootstrap.Admin/Api/InterfaceTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/InterfaceTest.cs @@ -4,7 +4,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class InterfaceTest : ApiTest + public class InterfaceTest : ApiWebHost { public InterfaceTest(BAWebHost factory) : base(factory, "Interface", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/LoginTest.cs b/UnitTest/Bootstrap.Admin/Api/LoginTest.cs index 38dabf7e..2fc93ae8 100644 --- a/UnitTest/Bootstrap.Admin/Api/LoginTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/LoginTest.cs @@ -3,7 +3,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class LoginTest : ApiTest + public class LoginTest : ApiWebHost { public LoginTest(BAWebHost factory) : base(factory, "Login", false) { diff --git a/UnitTest/Bootstrap.Admin/Api/LogsTest.cs b/UnitTest/Bootstrap.Admin/Api/LogsTest.cs index 778915ca..df1f60e1 100644 --- a/UnitTest/Bootstrap.Admin/Api/LogsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/LogsTest.cs @@ -4,7 +4,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class LogsTest : ApiTest + public class LogsTest : ApiWebHost { public LogsTest(BAWebHost factory) : base(factory, "Logs", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/MenusTest.cs b/UnitTest/Bootstrap.Admin/Api/MenusTest.cs index c918e7d4..201b76ca 100644 --- a/UnitTest/Bootstrap.Admin/Api/MenusTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/MenusTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class MenusTest : ApiTest + public class MenusTest : ApiWebHost { public MenusTest(BAWebHost factory) : base(factory, "Menus", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/MessagesTest.cs b/UnitTest/Bootstrap.Admin/Api/MessagesTest.cs index 028533a8..89ed75a6 100644 --- a/UnitTest/Bootstrap.Admin/Api/MessagesTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/MessagesTest.cs @@ -5,7 +5,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class MessagesTest : ApiTest + public class MessagesTest : ApiWebHost { public MessagesTest(BAWebHost factory) : base(factory, "Messages", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/NewTest.cs b/UnitTest/Bootstrap.Admin/Api/NewTest.cs index 0fca73f3..3bb77cb0 100644 --- a/UnitTest/Bootstrap.Admin/Api/NewTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/NewTest.cs @@ -5,7 +5,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class NewTest : ApiTest + public class NewTest : ApiWebHost { public NewTest(BAWebHost factory) : base(factory, "New", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/NotificationsTest.cs b/UnitTest/Bootstrap.Admin/Api/NotificationsTest.cs index a56d71c9..41276443 100644 --- a/UnitTest/Bootstrap.Admin/Api/NotificationsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/NotificationsTest.cs @@ -2,7 +2,7 @@ namespace Bootstrap.Admin.Api { - public class NotificationsTest : ApiTest + public class NotificationsTest : ApiWebHost { public NotificationsTest(BAWebHost factory) : base(factory, "Notifications", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs b/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs index 57d9efc8..ec0b1e91 100644 --- a/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs @@ -4,7 +4,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class RegisterTest : ApiTest + public class RegisterTest : ApiWebHost { public RegisterTest(BAWebHost factory) : base(factory, "Register", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/RolesTest.cs b/UnitTest/Bootstrap.Admin/Api/RolesTest.cs index 09ad18e0..62392f07 100644 --- a/UnitTest/Bootstrap.Admin/Api/RolesTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/RolesTest.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace Bootstrap.Admin.Api { - public class RolesTest : ApiTest + public class RolesTest : ApiWebHost { public RolesTest(BAWebHost factory) : base(factory, "Roles", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/SettingsTest.cs b/UnitTest/Bootstrap.Admin/Api/SettingsTest.cs index 91341c68..1ad87842 100644 --- a/UnitTest/Bootstrap.Admin/Api/SettingsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/SettingsTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class SettingsTest : ApiTest + public class SettingsTest : ApiWebHost { public SettingsTest(BAWebHost factory) : base(factory, "Settings", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/TasksTest.cs b/UnitTest/Bootstrap.Admin/Api/TasksTest.cs index ffe09a7b..321c019b 100644 --- a/UnitTest/Bootstrap.Admin/Api/TasksTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/TasksTest.cs @@ -4,7 +4,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class TasksTest : ApiTest + public class TasksTest : ApiWebHost { public TasksTest(BAWebHost factory) : base(factory, "Tasks", true) { diff --git a/UnitTest/Bootstrap.Admin/Api/UsersTest.cs b/UnitTest/Bootstrap.Admin/Api/UsersTest.cs index ab233f16..2b7643d1 100644 --- a/UnitTest/Bootstrap.Admin/Api/UsersTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/UsersTest.cs @@ -8,7 +8,7 @@ using Xunit; namespace Bootstrap.Admin.Api { - public class UsersTest : ApiTest + public class UsersTest : ApiWebHost { private BAWebHost _factory; diff --git a/UnitTest/Bootstrap.Admin/Controllers/AccountTest.cs b/UnitTest/Bootstrap.Admin/Controllers/AccountTest.cs index 4a198caf..9649f9ab 100644 --- a/UnitTest/Bootstrap.Admin/Controllers/AccountTest.cs +++ b/UnitTest/Bootstrap.Admin/Controllers/AccountTest.cs @@ -3,7 +3,7 @@ using Xunit; namespace Bootstrap.Admin.Controllers { - public class AccountTest : ControllerTest + public class AccountTest : ControllerWebHost { private BAWebHost _factory; diff --git a/UnitTest/Bootstrap.Admin/Controllers/AdminTest.cs b/UnitTest/Bootstrap.Admin/Controllers/AdminTest.cs index e33f2ec2..84062b26 100644 --- a/UnitTest/Bootstrap.Admin/Controllers/AdminTest.cs +++ b/UnitTest/Bootstrap.Admin/Controllers/AdminTest.cs @@ -4,7 +4,7 @@ using Xunit; namespace Bootstrap.Admin.Controllers { - public class AdminTest : ControllerTest + public class AdminTest : ControllerWebHost { public AdminTest(BAWebHost factory) : base(factory, "Admin", true) { diff --git a/UnitTest/Bootstrap.Admin/Controllers/ControllerTest.cs b/UnitTest/Bootstrap.Admin/Controllers/ControllerWebHost.cs similarity index 72% rename from UnitTest/Bootstrap.Admin/Controllers/ControllerTest.cs rename to UnitTest/Bootstrap.Admin/Controllers/ControllerWebHost.cs index f3de6ad0..abcbed6d 100644 --- a/UnitTest/Bootstrap.Admin/Controllers/ControllerTest.cs +++ b/UnitTest/Bootstrap.Admin/Controllers/ControllerWebHost.cs @@ -3,11 +3,11 @@ using Xunit; namespace Bootstrap.Admin.Controllers { - public class ControllerTest : IClassFixture + public class ControllerWebHost : IClassFixture { protected HttpClient Client { get; } - public ControllerTest(BAWebHost factory, string controller, bool login) + public ControllerWebHost(BAWebHost factory, string controller, bool login) { factory.ClientOptions.BaseAddress = new System.Uri($"http://localhost/{controller}/"); Client = factory.CreateClient(); diff --git a/UnitTest/Bootstrap.Admin/Controllers/HomeTest.cs b/UnitTest/Bootstrap.Admin/Controllers/HomeTest.cs index a02d90da..800b4520 100644 --- a/UnitTest/Bootstrap.Admin/Controllers/HomeTest.cs +++ b/UnitTest/Bootstrap.Admin/Controllers/HomeTest.cs @@ -3,7 +3,7 @@ using Xunit; namespace Bootstrap.Admin.Controllers { - public class HomeTest : ControllerTest + public class HomeTest : ControllerWebHost { public HomeTest(BAWebHost factory) : base(factory, "Home", true)