|
| 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