Exemple #1
0
        public async Task GetAllEnabledResourcesAsync_without_duplicate_api_scopes_should_succeed()
        {
            var store = new MockResourceStore()
            {
                ApiResources = { new ApiResource("A"), new ApiResource("B") }
            };

            await store.GetAllEnabledResourcesAsync();
        }
Exemple #2
0
        public void GetAllEnabledResourcesAsync_on_duplicate_api_scopes_should_fail()
        {
            var store = new MockResourceStore()
            {
                ApiResources = { new ApiResource("A"), new ApiResource("A") }
            };

            Func <Task> a = () => store.GetAllEnabledResourcesAsync();

            a.Should().Throw <Exception>().And.Message.ToLowerInvariant().Should().Contain("duplicate").And.Contain("api scopes");
        }
Exemple #3
0
        public async Task GetAllEnabledResourcesAsync_without_duplicate_identity_scopes_should_succeed()
        {
            var store = new MockResourceStore()
            {
                IdentityResources =
                {
                    new IdentityResource {
                        Name = "A"
                    },
                    new IdentityResource {
                        Name = "B"
                    }
                }
            };

            await store.GetAllEnabledResourcesAsync();
        }
Exemple #4
0
        public void GetAllEnabledResourcesAsync_on_duplicate_identity_scopes_should_fail()
        {
            var store = new MockResourceStore()
            {
                IdentityResources =
                {
                    new IdentityResource {
                        Name = "A"
                    },
                    new IdentityResource {
                        Name = "A"
                    }
                }
            };

            Func <Task> a = () => store.GetAllEnabledResourcesAsync();

            a.Should().Throw <Exception>().And.Message.ToLowerInvariant().Should().Contain("duplicate").And.Contain("identity scopes");
        }