Skip to content

Commit e5d119e

Browse files
Merge pull request #3939 from imcarolwang/issue3809
Unit test for IssuedSecurityTokenParameters.
2 parents 510fc4d + 23c4f1c commit e5d119e

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
6+
using System.IdentityModel.Tokens;
7+
using System.ServiceModel;
8+
using System.ServiceModel.Security.Tokens;
9+
using Infrastructure.Common;
10+
using Xunit;
11+
12+
public static class IssuedSecurityTokenParametersTest
13+
{
14+
[WcfFact]
15+
public static void Ctor_Default()
16+
{
17+
IssuedSecurityTokenParameters tokenParameters = new IssuedSecurityTokenParameters();
18+
Assert.NotNull(tokenParameters);
19+
}
20+
21+
[WcfFact]
22+
public static void Properties_Settable()
23+
{
24+
var edpa = new EndpointAddress("https://localhost");
25+
var binding = new BasicHttpsBinding();
26+
string tokenType = "http://schemas.microsoft.com/ws/2006/05/identitymodel/securitytokenrequirement/TokenType";
27+
28+
IssuedSecurityTokenParameters tokenParameters = new IssuedSecurityTokenParameters()
29+
{
30+
DefaultMessageSecurityVersion = MessageSecurityVersion.Default,
31+
IssuerAddress = edpa,
32+
IssuerBinding = binding,
33+
KeyType = SecurityKeyType.AsymmetricKey,
34+
TokenType = tokenType
35+
};
36+
37+
Assert.Equal(MessageSecurityVersion.Default, tokenParameters.DefaultMessageSecurityVersion);
38+
Assert.Equal(edpa, tokenParameters.IssuerAddress);
39+
Assert.Equal(binding, tokenParameters.IssuerBinding);
40+
Assert.Equal(SecurityKeyType.AsymmetricKey, tokenParameters.KeyType);
41+
Assert.Equal(tokenType, tokenParameters.TokenType);
42+
}
43+
}

0 commit comments

Comments
 (0)