单元测试:重命名ApiWebHost/ControllerWebHost
This commit is contained in:
parent
80a6915bad
commit
edcfbeeebb
|
@ -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();
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Bootstrap.Admin.Api
|
||||
{
|
||||
public class NotificationsTest : ApiTest
|
||||
public class NotificationsTest : ApiWebHost
|
||||
{
|
||||
public NotificationsTest(BAWebHost factory) : base(factory, "Notifications", true)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ using Xunit;
|
|||
|
||||
namespace Bootstrap.Admin.Api
|
||||
{
|
||||
public class UsersTest : ApiTest
|
||||
public class UsersTest : ApiWebHost
|
||||
{
|
||||
private BAWebHost _factory;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using Xunit;
|
|||
|
||||
namespace Bootstrap.Admin.Controllers
|
||||
{
|
||||
public class AccountTest : ControllerTest
|
||||
public class AccountTest : ControllerWebHost
|
||||
{
|
||||
private BAWebHost _factory;
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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();
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue