using Bootstrap.Security; using System.Collections.Generic; using Xunit; namespace Bootstrap.Admin.Api.SqlServer { public class InterfaceTest : ControllerTest { public InterfaceTest(BAWebHost factory) : base(factory, "api/Interface") { } [Fact] public async void RetrieveDicts_Ok() { var ret = await Client.PostAsJsonAsync>("RetrieveDicts", ""); Assert.NotEmpty(ret); } [Fact] public async void RetrieveRolesByUrl_Ok() { var ret = await Client.PostAsJsonAsync>("RetrieveRolesByUrl", "~/Admin/Index"); Assert.NotEmpty(ret); } [Fact] public async void RetrieveRolesByUserName_Ok() { var ret = await Client.PostAsJsonAsync>("RetrieveRolesByUserName", "Admin"); Assert.NotEmpty(ret); } [Fact] public async void RetrieveUserByUserName_Ok() { var ret = await Client.PostAsJsonAsync("RetrieveUserByUserName", "Admin"); Assert.Equal("Admin", ret.UserName); } [Fact] public async void RetrieveAppMenus_Ok() { var ret = await Client.PostAsJsonAsync>("RetrieveAppMenus", new AppMenuOption() { AppId = "0", UserName = "Admin", Url = "~/Admin/Index" }); Assert.NotEmpty(ret); } } }