单元测试:重命名ApiWebHost/ControllerWebHost

This commit is contained in:
Argo-Surface 2019-01-16 18:18:57 +08:00
parent 80a6915bad
commit edcfbeeebb
21 changed files with 23 additions and 23 deletions

View File

@ -3,11 +3,11 @@ using Xunit;
namespace Bootstrap.Admin.Api
{
public class ApiTest : IClassFixture<BAWebHost>
public class ApiWebHost : IClassFixture<BAWebHost>
{
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();

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -2,7 +2,7 @@
namespace Bootstrap.Admin.Api
{
public class NotificationsTest : ApiTest
public class NotificationsTest : ApiWebHost
{
public NotificationsTest(BAWebHost factory) : base(factory, "Notifications", true)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -8,7 +8,7 @@ using Xunit;
namespace Bootstrap.Admin.Api
{
public class UsersTest : ApiTest
public class UsersTest : ApiWebHost
{
private BAWebHost _factory;

View File

@ -3,7 +3,7 @@ using Xunit;
namespace Bootstrap.Admin.Controllers
{
public class AccountTest : ControllerTest
public class AccountTest : ControllerWebHost
{
private BAWebHost _factory;

View File

@ -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)
{

View File

@ -3,11 +3,11 @@ using Xunit;
namespace Bootstrap.Admin.Controllers
{
public class ControllerTest : IClassFixture<BAWebHost>
public class ControllerWebHost : IClassFixture<BAWebHost>
{
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();

View File

@ -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)