示例#1
0
        private static void AssertRst(TestableWsTrustClient client, string expectedRstAppliesTo)
        {
            RequestSecurityToken rst = client.Rst;

            rst.Should().NotBeNull();
            rst.ActAs.Should().BeNull();
            rst.AppliesTo.Uri.AbsoluteUri.Should().BeEquivalentTo(expectedRstAppliesTo);
        }
        public void should_match_request_token()
        {
            // Arrange
            RequestSecurityToken requestSecurityToken = null;

            this.channel.Issue(
                Arg.Do <RequestSecurityToken>(x => requestSecurityToken = x),
                out this.requestSecurityTokenResponse);

            // Act
            this.tokenGetter.GetToken(UrnStsendpoint, TrustVersion.Default, ApplyToUri, this.credential);

            // Assert
            requestSecurityToken.Should().Match <RequestSecurityToken>(
                x =>
                x.RequestType == RequestTypes.Issue &&
                x.AppliesTo.Uri == new Uri(ApplyToUri) &&
                x.KeyType == KeyTypes.Bearer);
        }