コード例 #1
0
        public RbacServiceTests()
        {
            _identityProvider      = GetIdentityProvider("aad", "test", "https://microsoft.onmicrosoft.com/common/");
            _controlPlaneDataStore = Substitute.For <IControlPlaneDataStore>();
            _controlPlaneDataStore.GetIdentityProviderAsync(_identityProvider.Name, Arg.Any <CancellationToken>()).Returns(_identityProvider);
            _controlPlaneDataStore.UpsertIdentityProviderAsync(_identityProvider, Arg.Any <string>(), Arg.Any <CancellationToken>()).Returns(new UpsertResponse <IdentityProvider>(_identityProvider, UpsertOutcome.Updated, "testEtag"));

            _rbacService = new RbacService(_controlPlaneDataStore);
        }
コード例 #2
0
        public RbacServiceTests()
        {
            _identityProvider = new IdentityProvider("aad", "https://login.microsoftonline.com/common", new List <string> {
                "test"
            }, "1");
            _controlPlaneDataStore = Substitute.For <IControlPlaneDataStore>();
            _controlPlaneDataStore.GetIdentityProviderAsync(_identityProvider.Name, Arg.Any <CancellationToken>()).Returns(_identityProvider);
            _controlPlaneDataStore.UpsertIdentityProviderAsync(_identityProvider, Arg.Any <CancellationToken>()).Returns(_identityProvider);

            _rbacService = new RbacService(_controlPlaneDataStore);
        }
コード例 #3
0
        public RbacServiceTests()
        {
            _identityProvider = GetIdentityProvider("aad", "test", "https://microsoft.onmicrosoft.com/common/");

            _controlPlaneDataStore = Substitute.For <IControlPlaneDataStore>();
            _controlPlaneDataStore.GetIdentityProviderAsync(_identityProvider.Name, Arg.Any <CancellationToken>()).Returns(_identityProvider);
            _controlPlaneDataStore.UpsertIdentityProviderAsync(_identityProvider, Arg.Any <string>(), Arg.Any <CancellationToken>()).Returns(new UpsertResponse <IdentityProvider>(_identityProvider, UpsertOutcome.Updated, "testEtag"));

            IList <ResourcePermission> resourcePermissions = new List <ResourcePermission>();

            _role = GetRole("clinician", resourcePermissions);
            _controlPlaneDataStore.GetRoleAsync(_role.Name, Arg.Any <CancellationToken>()).Returns(_role);
            _controlPlaneDataStore.UpsertRoleAsync(_role, Arg.Any <string>(), Arg.Any <CancellationToken>()).Returns(new UpsertResponse <Role>(_role, UpsertOutcome.Updated, "testEtag"));
            _controlPlaneDataStore.DeleteRoleAsync(_role.Name, Arg.Any <string>(), Arg.Any <CancellationToken>());

            _rbacService = new RbacService(_controlPlaneDataStore);
        }