Ejemplo n.º 1
0
        public async Task WhenIGetTheIdentityResourceWithNameTheIdentityResourceDetailsAreReturnedAsFollows(String identityResourceName, Table table)
        {
            IdentityResourceDetails identityResourceDetails = await this.GetIdentityResource(identityResourceName, CancellationToken.None).ConfigureAwait(false);

            table.Rows.Count.ShouldBe(1);
            TableRow tableRow = table.Rows.First();

            identityResourceDetails.ShouldNotBeNull();

            String userClaims = SpecflowTableHelper.GetStringRowValue(tableRow, "UserClaims");

            identityResourceDetails.Description.ShouldBe(SpecflowTableHelper.GetStringRowValue(tableRow, "Description"));
            identityResourceDetails.Name.ShouldBe(SpecflowTableHelper.GetStringRowValue(tableRow, "Name"));
            identityResourceDetails.DisplayName.ShouldBe(SpecflowTableHelper.GetStringRowValue(tableRow, "DisplayName"));

            if (string.IsNullOrEmpty(userClaims))
            {
                identityResourceDetails.Claims.ShouldBeEmpty();
            }
            else
            {
                identityResourceDetails.Claims.ShouldBe(userClaims.Split(",").ToList());
            }
        }