2024-03-28 14:30:22 +01:00
|
|
|
|
// using FabAccessAPI;
|
|
|
|
|
// using FabAccessAPI.Schema;
|
|
|
|
|
// using NUnit.Framework;
|
|
|
|
|
// using NUnit.Framework.Legacy;
|
|
|
|
|
// using System.Collections.Generic;
|
|
|
|
|
// using System.Threading.Tasks;
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// namespace FabAccessAPI_Test.API_TestEnv
|
|
|
|
|
// {
|
|
|
|
|
// [TestFixture, Parallelizable(ParallelScope.Children)]
|
|
|
|
|
// [Order(1)]
|
|
|
|
|
// public class PermissionSystem_Test_Stateless
|
|
|
|
|
// {
|
|
|
|
|
// [TestCase("Admin1", true)]
|
|
|
|
|
// [TestCase("ManagerA1", true)]
|
|
|
|
|
// [TestCase("MakerA1", true)]
|
|
|
|
|
// [TestCase("GuestA1", true)]
|
|
|
|
|
// [Order(1)]
|
|
|
|
|
// public async Task AccessPermissionSystem(string username, bool expectInterface)
|
|
|
|
|
// {
|
|
|
|
|
// API api = new API();
|
|
|
|
|
// ConnectionData connectionData = TestEnv.CreateConnetionData(username);
|
|
|
|
|
// await api.Connect(connectionData);
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// bool result = api.Session.PermissionSystem != null;
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// await api.Disconnect();
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// ClassicAssert.AreEqual(expectInterface, result);
|
|
|
|
|
// }
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// [TestCase("Admin1", true)]
|
|
|
|
|
// [TestCase("ManagerA1", true)]
|
|
|
|
|
// [TestCase("MakerA1", true)]
|
|
|
|
|
// [TestCase("GuestA1", true)]
|
|
|
|
|
// [Order(2)]
|
|
|
|
|
// public async Task InfoInterface(string username, bool expectInterface)
|
|
|
|
|
// {
|
|
|
|
|
// API api = new API();
|
|
|
|
|
// ConnectionData connectionData = TestEnv.CreateConnetionData(username);
|
|
|
|
|
// await api.Connect(connectionData);
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// PermissionSystem.InfoInterface_Proxy infoInterface = (PermissionSystem.InfoInterface_Proxy)api.Session.PermissionSystem.Info;
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// bool result = !infoInterface.IsNull;
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// await api.Disconnect();
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// ClassicAssert.AreEqual(expectInterface, result);
|
|
|
|
|
// }
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// [TestCase("Admin1", 13)]
|
|
|
|
|
// [TestCase("ManagerA1", 13)]
|
|
|
|
|
// [TestCase("MakerA1", 13)]
|
|
|
|
|
// [TestCase("GuestA1", 13)]
|
|
|
|
|
// [Order(3), Ignore("Not implemented")]
|
|
|
|
|
// public async Task ListRoles(string username, int expectRolesCount)
|
|
|
|
|
// {
|
|
|
|
|
// API api = new API();
|
|
|
|
|
// ConnectionData connectionData = TestEnv.CreateConnetionData(username);
|
|
|
|
|
// await api.Connect(connectionData);
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// IReadOnlyList<Role> roles_list = await api.Session.PermissionSystem.Info.GetRoleList().ConfigureAwait(false);
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// await api.Disconnect();
|
2024-03-11 22:38:56 +01:00
|
|
|
|
|
2024-03-28 14:30:22 +01:00
|
|
|
|
// ClassicAssert.AreEqual(expectRolesCount, roles_list.Count);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|