-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test for IssuedSecurityTokenParameters.
- Loading branch information
1 parent
f296b23
commit 23c4f1c
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/System.ServiceModel.Security/tests/ServiceModel/IssuedSecurityTokenParametersTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
|
||
using System.IdentityModel.Tokens; | ||
using System.ServiceModel; | ||
using System.ServiceModel.Security.Tokens; | ||
using Infrastructure.Common; | ||
using Xunit; | ||
|
||
public static class IssuedSecurityTokenParametersTest | ||
{ | ||
[WcfFact] | ||
public static void Ctor_Default() | ||
{ | ||
IssuedSecurityTokenParameters tokenParameters = new IssuedSecurityTokenParameters(); | ||
Assert.NotNull(tokenParameters); | ||
} | ||
|
||
[WcfFact] | ||
public static void Properties_Settable() | ||
{ | ||
var edpa = new EndpointAddress("https://localhost"); | ||
var binding = new BasicHttpsBinding(); | ||
string tokenType = "http://schemas.microsoft.com/ws/2006/05/identitymodel/securitytokenrequirement/TokenType"; | ||
|
||
IssuedSecurityTokenParameters tokenParameters = new IssuedSecurityTokenParameters() | ||
{ | ||
DefaultMessageSecurityVersion = MessageSecurityVersion.Default, | ||
IssuerAddress = edpa, | ||
IssuerBinding = binding, | ||
KeyType = SecurityKeyType.AsymmetricKey, | ||
TokenType = tokenType | ||
}; | ||
|
||
Assert.Equal(MessageSecurityVersion.Default, tokenParameters.DefaultMessageSecurityVersion); | ||
Assert.Equal(edpa, tokenParameters.IssuerAddress); | ||
Assert.Equal(binding, tokenParameters.IssuerBinding); | ||
Assert.Equal(SecurityKeyType.AsymmetricKey, tokenParameters.KeyType); | ||
Assert.Equal(tokenType, tokenParameters.TokenType); | ||
} | ||
} |