2 // ServiceBehaviorElementTest.cs
5 // Igor Zelmanovich <igorz@mainsoft.com>
7 // Copyright (C) 2008 Mainsoft, Inc. http://www.mainsoft.com
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 using System.Collections.Generic;
32 using NUnit.Framework;
33 using System.ServiceModel.Configuration;
34 using System.ServiceModel.Description;
35 using System.Configuration;
36 using System.ServiceModel;
37 using System.Security.Cryptography.X509Certificates;
38 using System.ServiceModel.Security;
40 namespace MonoTests.System.ServiceModel.Configuration
43 public class ServiceBehaviorElementTest
45 ServiceBehaviorElement OpenConfig () {
46 ServiceModelSectionGroup config = (ServiceModelSectionGroup) ConfigurationManager.OpenExeConfiguration ("Test/config/serviceBehaviors").GetSectionGroup ("system.serviceModel");
47 return config.Behaviors.ServiceBehaviors [0];
51 public void ServiceAuthorizationElement () {
52 ServiceBehaviorElement behavior = OpenConfig ();
53 ServiceAuthorizationElement serviceAuthorization = (ServiceAuthorizationElement) behavior [typeof (ServiceAuthorizationElement)];
55 if (serviceAuthorization == null)
56 Assert.Fail ("ServiceAuthorizationElement is not exist in collection.");
58 Assert.AreEqual (typeof (ServiceAuthorizationBehavior), serviceAuthorization.BehaviorType, "BehaviorType");
59 Assert.AreEqual ("serviceAuthorization", serviceAuthorization.ConfigurationElementName, "ConfigurationElementName");
61 Assert.AreEqual ("RoleProvider", serviceAuthorization.RoleProviderName, "RoleProviderName");
62 Assert.AreEqual (PrincipalPermissionMode.UseAspNetRoles, serviceAuthorization.PrincipalPermissionMode, "PrincipalPermissionMode");
63 Assert.AreEqual (true, serviceAuthorization.ImpersonateCallerForAllOperations, "ImpersonateCallerForAllOperations");
64 Assert.AreEqual ("SerAuthManagType", serviceAuthorization.ServiceAuthorizationManagerType, "ServiceAuthorizationManagerType");
66 Assert.AreEqual (2, serviceAuthorization.AuthorizationPolicies.Count, "AuthorizationPolicies.Count");
67 Assert.AreEqual ("PolicyType1", serviceAuthorization.AuthorizationPolicies [0].PolicyType, "AuthorizationPolicies[0].PolicyType");
68 Assert.AreEqual ("PolicyType2", serviceAuthorization.AuthorizationPolicies [1].PolicyType, "AuthorizationPolicies[1].PolicyType");
72 public void ServiceAuthorizationElement_default () {
73 ServiceAuthorizationElement serviceAuthorization = new ServiceAuthorizationElement ();
75 Assert.AreEqual (typeof (ServiceAuthorizationBehavior), serviceAuthorization.BehaviorType, "BehaviorType");
76 Assert.AreEqual ("serviceAuthorization", serviceAuthorization.ConfigurationElementName, "ConfigurationElementName");
78 Assert.AreEqual (String.Empty, serviceAuthorization.RoleProviderName, "RoleProviderName");
79 Assert.AreEqual (PrincipalPermissionMode.UseWindowsGroups, serviceAuthorization.PrincipalPermissionMode, "PrincipalPermissionMode");
80 Assert.AreEqual (false, serviceAuthorization.ImpersonateCallerForAllOperations, "ImpersonateCallerForAllOperations");
81 Assert.AreEqual (String.Empty, serviceAuthorization.ServiceAuthorizationManagerType, "ServiceAuthorizationManagerType");
83 Assert.AreEqual (0, serviceAuthorization.AuthorizationPolicies.Count, "AuthorizationPolicies.Count");
87 public void DataContractSerializerElement () {
88 ServiceBehaviorElement behavior = OpenConfig ();
89 DataContractSerializerElement element = (DataContractSerializerElement) behavior [typeof (DataContractSerializerElement)];
92 Assert.Fail ("DataContractSerializerElement is not exist in collection.");
94 Assert.AreEqual ("System.ServiceModel.Dispatcher.DataContractSerializerServiceBehavior", element.BehaviorType.FullName, "BehaviorType");
95 Assert.AreEqual ("dataContractSerializer", element.ConfigurationElementName, "ConfigurationElementName");
97 Assert.AreEqual (true, element.IgnoreExtensionDataObject, "IgnoreExtensionDataObject");
98 Assert.AreEqual (32768, element.MaxItemsInObjectGraph, "MaxItemsInObjectGraph");
102 public void DataContractSerializerElement_defaults () {
103 DataContractSerializerElement element = new DataContractSerializerElement ();
105 Assert.AreEqual ("System.ServiceModel.Dispatcher.DataContractSerializerServiceBehavior", element.BehaviorType.FullName, "BehaviorType");
106 Assert.AreEqual ("dataContractSerializer", element.ConfigurationElementName, "ConfigurationElementName");
108 Assert.AreEqual (false, element.IgnoreExtensionDataObject, "IgnoreExtensionDataObject");
109 Assert.AreEqual (65536, element.MaxItemsInObjectGraph, "MaxItemsInObjectGraph");
113 public void ServiceDebugElement () {
114 ServiceBehaviorElement behavior = OpenConfig ();
115 ServiceDebugElement element = (ServiceDebugElement) behavior [typeof (ServiceDebugElement)];
118 Assert.Fail ("ServiceDebugElement is not exist in collection.");
120 Assert.AreEqual (typeof (ServiceDebugBehavior), element.BehaviorType, "BehaviorType");
121 Assert.AreEqual ("serviceDebug", element.ConfigurationElementName, "ConfigurationElementName");
123 Assert.AreEqual (false, element.HttpHelpPageEnabled, "HttpHelpPageEnabled");
124 Assert.AreEqual ("http://help.page.url", element.HttpHelpPageUrl.OriginalString, "HttpHelpPageUrl");
125 Assert.AreEqual (false, element.HttpsHelpPageEnabled, "HttpsHelpPageEnabled");
126 Assert.AreEqual ("https://help.page.url", element.HttpsHelpPageUrl.OriginalString, "HttpsHelpPageUrl");
127 Assert.AreEqual (true, element.IncludeExceptionDetailInFaults, "IncludeExceptionDetailInFaults");
131 public void ServiceDebugElement_defaults () {
132 ServiceDebugElement element = new ServiceDebugElement ();
134 Assert.AreEqual (typeof (ServiceDebugBehavior), element.BehaviorType, "BehaviorType");
135 Assert.AreEqual ("serviceDebug", element.ConfigurationElementName, "ConfigurationElementName");
137 Assert.AreEqual (true, element.HttpHelpPageEnabled, "HttpHelpPageEnabled");
138 Assert.AreEqual (null, element.HttpHelpPageUrl, "HttpHelpPageUrl");
139 Assert.AreEqual (true, element.HttpsHelpPageEnabled, "HttpsHelpPageEnabled");
140 Assert.AreEqual (null, element.HttpsHelpPageUrl, "HttpsHelpPageUrl");
141 Assert.AreEqual (false, element.IncludeExceptionDetailInFaults, "IncludeExceptionDetailInFaults");
145 public void ServiceMetadataPublishingElement () {
146 ServiceBehaviorElement behavior = OpenConfig ();
147 ServiceMetadataPublishingElement element = (ServiceMetadataPublishingElement) behavior [typeof (ServiceMetadataPublishingElement)];
150 Assert.Fail ("ServiceMetadataPublishingElement is not exist in collection.");
152 Assert.AreEqual (typeof (ServiceMetadataBehavior), element.BehaviorType, "BehaviorType");
153 Assert.AreEqual ("serviceMetadata", element.ConfigurationElementName, "ConfigurationElementName");
155 Assert.AreEqual (true, element.HttpGetEnabled, "HttpGetEnabled");
156 Assert.AreEqual ("http://get.url", element.HttpGetUrl.OriginalString, "HttpGetUrl");
157 Assert.AreEqual (true, element.HttpsGetEnabled, "HttpsGetEnabled");
158 Assert.AreEqual ("https://get.url", element.HttpsGetUrl.OriginalString, "HttpsHelpPageUrl");
159 Assert.AreEqual ("http://external.metadata.location", element.ExternalMetadataLocation.OriginalString, "ExternalMetadataLocation");
160 Assert.AreEqual (PolicyVersion.Policy12, element.PolicyVersion, "PolicyVersion");
164 public void ServiceMetadataPublishingElement_defaults () {
165 ServiceMetadataPublishingElement element = new ServiceMetadataPublishingElement ();
167 Assert.AreEqual (typeof (ServiceMetadataBehavior), element.BehaviorType, "BehaviorType");
168 Assert.AreEqual ("serviceMetadata", element.ConfigurationElementName, "ConfigurationElementName");
170 Assert.AreEqual (false, element.HttpGetEnabled, "HttpGetEnabled");
171 Assert.AreEqual (null, element.HttpGetUrl, "HttpGetUrl");
172 Assert.AreEqual (false, element.HttpsGetEnabled, "HttpsGetEnabled");
173 Assert.AreEqual (null, element.HttpsGetUrl, "HttpsGetUrl");
174 Assert.AreEqual (null, element.ExternalMetadataLocation, "ExternalMetadataLocation");
175 Assert.AreEqual (PolicyVersion.Default, element.PolicyVersion, "PolicyVersion");
179 public void ServiceSecurityAuditElement () {
180 ServiceBehaviorElement behavior = OpenConfig ();
181 ServiceSecurityAuditElement element = (ServiceSecurityAuditElement) behavior [typeof (ServiceSecurityAuditElement)];
184 Assert.Fail ("ServiceSecurityAuditElement is not exist in collection.");
186 Assert.AreEqual (typeof (ServiceSecurityAuditBehavior), element.BehaviorType, "BehaviorType");
187 Assert.AreEqual ("serviceSecurityAudit", element.ConfigurationElementName, "ConfigurationElementName");
189 Assert.AreEqual (AuditLogLocation.Application, element.AuditLogLocation, "AuditLogLocation");
190 Assert.AreEqual (false, element.SuppressAuditFailure, "SuppressAuditFailure");
191 Assert.AreEqual (AuditLevel.Success, element.ServiceAuthorizationAuditLevel, "ServiceAuthorizationAuditLevel");
192 Assert.AreEqual (AuditLevel.Success, element.MessageAuthenticationAuditLevel, "MessageAuthenticationAuditLevel");
196 public void ServiceSecurityAuditElement_defaults () {
197 ServiceSecurityAuditElement element = new ServiceSecurityAuditElement ();
199 Assert.AreEqual (typeof (ServiceSecurityAuditBehavior), element.BehaviorType, "BehaviorType");
200 Assert.AreEqual ("serviceSecurityAudit", element.ConfigurationElementName, "ConfigurationElementName");
202 Assert.AreEqual (AuditLogLocation.Default, element.AuditLogLocation, "AuditLogLocation");
203 Assert.AreEqual (true, element.SuppressAuditFailure, "SuppressAuditFailure");
204 Assert.AreEqual (AuditLevel.None, element.ServiceAuthorizationAuditLevel, "ServiceAuthorizationAuditLevel");
205 Assert.AreEqual (AuditLevel.None, element.MessageAuthenticationAuditLevel, "MessageAuthenticationAuditLevel");
209 public void ServiceThrottlingElement () {
210 ServiceBehaviorElement behavior = OpenConfig ();
211 ServiceThrottlingElement element = (ServiceThrottlingElement) behavior [typeof (ServiceThrottlingElement)];
214 Assert.Fail ("ServiceThrottlingElement is not exist in collection.");
216 Assert.AreEqual (typeof (ServiceThrottlingBehavior), element.BehaviorType, "BehaviorType");
217 Assert.AreEqual ("serviceThrottling", element.ConfigurationElementName, "ConfigurationElementName");
219 Assert.AreEqual (32, element.MaxConcurrentCalls, "MaxConcurrentCalls");
220 Assert.AreEqual (20, element.MaxConcurrentSessions, "MaxConcurrentSessions");
221 Assert.AreEqual (14, element.MaxConcurrentInstances, "MaxConcurrentInstances");
225 public void ServiceThrottlingElement_defaults () {
226 ServiceThrottlingElement element = new ServiceThrottlingElement ();
228 Assert.AreEqual (typeof (ServiceThrottlingBehavior), element.BehaviorType, "BehaviorType");
229 Assert.AreEqual ("serviceThrottling", element.ConfigurationElementName, "ConfigurationElementName");
231 Assert.AreEqual (16, element.MaxConcurrentCalls, "MaxConcurrentCalls");
232 Assert.AreEqual (10, element.MaxConcurrentSessions, "MaxConcurrentSessions");
233 Assert.AreEqual (26, element.MaxConcurrentInstances, "MaxConcurrentInstances");
237 public void ServiceTimeoutsElement () {
238 ServiceBehaviorElement behavior = OpenConfig ();
239 ServiceTimeoutsElement element = (ServiceTimeoutsElement) behavior [typeof (ServiceTimeoutsElement)];
242 Assert.Fail ("ServiceTimeoutsElement is not exist in collection.");
244 Assert.AreEqual ("System.ServiceModel.Description.ServiceTimeoutsBehavior", element.BehaviorType.FullName, "BehaviorType");
245 Assert.AreEqual ("serviceTimeouts", element.ConfigurationElementName, "ConfigurationElementName");
247 Assert.AreEqual (new TimeSpan (0, 3, 0), element.TransactionTimeout, "TransactionTimeout");
251 public void ServiceTimeoutsElement_defaults () {
252 ServiceTimeoutsElement element = new ServiceTimeoutsElement ();
254 Assert.AreEqual ("System.ServiceModel.Description.ServiceTimeoutsBehavior", element.BehaviorType.FullName, "BehaviorType");
255 Assert.AreEqual ("serviceTimeouts", element.ConfigurationElementName, "ConfigurationElementName");
257 Assert.AreEqual (new TimeSpan (0, 0, 0), element.TransactionTimeout, "TransactionTimeout");
261 public void ServiceCredentialsElement () {
262 ServiceBehaviorElement behavior = OpenConfig ();
263 ServiceCredentialsElement element = (ServiceCredentialsElement) behavior [typeof (ServiceCredentialsElement)];
266 Assert.Fail ("ServiceCredentialsElement is not exist in collection.");
268 Assert.AreEqual (typeof (ServiceCredentials), element.BehaviorType, "BehaviorType");
269 Assert.AreEqual ("serviceCredentials", element.ConfigurationElementName, "ConfigurationElementName");
271 Assert.AreEqual ("ServiceCredentialsType", element.Type, "Type");
273 Assert.AreEqual ("FindValue", element.ClientCertificate.Certificate.FindValue, "ClientCertificate.Certificate.FindValue");
274 Assert.AreEqual (StoreLocation.CurrentUser, element.ClientCertificate.Certificate.StoreLocation, "ClientCertificate.Certificate.StoreLocation");
275 Assert.AreEqual (StoreName.Root, element.ClientCertificate.Certificate.StoreName, "ClientCertificate.Certificate.StoreName");
276 Assert.AreEqual (X509FindType.FindByIssuerName, element.ClientCertificate.Certificate.X509FindType, "ClientCertificate.Certificate.X509FindType");
278 Assert.AreEqual ("CustomCertificateValidationType", element.ClientCertificate.Authentication.CustomCertificateValidatorType, "ClientCertificate.Authentication.CustomCertificateValidatorType");
279 Assert.AreEqual (X509CertificateValidationMode.PeerOrChainTrust, element.ClientCertificate.Authentication.CertificateValidationMode, "ClientCertificate.Authentication.CustomCertificateValidatorType");
280 Assert.AreEqual (X509RevocationMode.Offline, element.ClientCertificate.Authentication.RevocationMode, "ClientCertificate.Authentication.RevocationMode");
281 Assert.AreEqual (StoreLocation.CurrentUser, element.ClientCertificate.Authentication.TrustedStoreLocation, "ClientCertificate.Authentication.TrustedStoreLocation");
282 Assert.AreEqual (false, element.ClientCertificate.Authentication.IncludeWindowsGroups, "ClientCertificate.Authentication.IncludeWindowsGroups");
283 Assert.AreEqual (true, element.ClientCertificate.Authentication.MapClientCertificateToWindowsAccount, "ClientCertificate.Authentication.MapClientCertificateToWindowsAccount");
285 Assert.AreEqual ("FindValue", element.ServiceCertificate.FindValue, "ServiceCertificate.FindValue");
286 Assert.AreEqual (StoreLocation.CurrentUser, element.ServiceCertificate.StoreLocation, "ServiceCertificate.StoreLocation");
287 Assert.AreEqual (StoreName.Root, element.ServiceCertificate.StoreName, "ServiceCertificate.StoreName");
288 Assert.AreEqual (X509FindType.FindByIssuerName, element.ServiceCertificate.X509FindType, "ServiceCertificate.X509FindType");
290 Assert.AreEqual (UserNamePasswordValidationMode.MembershipProvider, element.UserNameAuthentication.UserNamePasswordValidationMode, "UserNameAuthentication.UserNamePasswordValidationMode");
291 Assert.AreEqual (false, element.UserNameAuthentication.IncludeWindowsGroups, "UserNameAuthentication.IncludeWindowsGroups");
292 Assert.AreEqual ("MembershipProviderName", element.UserNameAuthentication.MembershipProviderName, "UserNameAuthentication.MembershipProviderName");
293 Assert.AreEqual ("CustomUserNamePasswordValidatorType", element.UserNameAuthentication.CustomUserNamePasswordValidatorType, "UserNameAuthentication.customUserNamePasswordValidatorType");
294 Assert.AreEqual (true, element.UserNameAuthentication.CacheLogonTokens, "UserNameAuthentication.CacheLogonTokens");
295 Assert.AreEqual (252, element.UserNameAuthentication.MaxCachedLogonTokens, "UserNameAuthentication.MaxCachedLogonTokens");
296 Assert.AreEqual (new TimeSpan (0, 30, 0), element.UserNameAuthentication.CachedLogonTokenLifetime, "UserNameAuthentication.CachedLogonTokenLifetime");
298 Assert.AreEqual ("FindValue", element.Peer.Certificate.FindValue, "Peer.Certificate.FindValue");
299 Assert.AreEqual (StoreLocation.LocalMachine, element.Peer.Certificate.StoreLocation, "Peer.Certificate.StoreLocation");
300 Assert.AreEqual (StoreName.Root, element.Peer.Certificate.StoreName, "Peer.Certificate.StoreName");
301 Assert.AreEqual (X509FindType.FindByIssuerName, element.Peer.Certificate.X509FindType, "Peer.Certificate.X509FindType");
303 Assert.AreEqual ("CustomCertificateValidatorType", element.Peer.PeerAuthentication.CustomCertificateValidatorType, "Peer.Authentication.CustomCertificateValidatorType");
304 Assert.AreEqual (X509CertificateValidationMode.Custom, element.Peer.PeerAuthentication.CertificateValidationMode, "Peer.Authentication.CustomCertificateValidatorType");
305 Assert.AreEqual (X509RevocationMode.Offline, element.Peer.PeerAuthentication.RevocationMode, "Peer.Authentication.RevocationMode");
306 Assert.AreEqual (StoreLocation.LocalMachine, element.Peer.PeerAuthentication.TrustedStoreLocation, "Peer.Authentication.TrustedStoreLocation");
308 Assert.AreEqual ("CustomCertificateValidatorType", element.Peer.MessageSenderAuthentication.CustomCertificateValidatorType, "Peer.MessageSenderAuthentication.CustomCertificateValidatorType");
309 Assert.AreEqual (X509CertificateValidationMode.None, element.Peer.MessageSenderAuthentication.CertificateValidationMode, "Peer.MessageSenderAuthentication.CustomCertificateValidatorType");
310 Assert.AreEqual (X509RevocationMode.Offline, element.Peer.MessageSenderAuthentication.RevocationMode, "Peer.MessageSenderAuthentication.RevocationMode");
311 Assert.AreEqual (StoreLocation.LocalMachine, element.Peer.MessageSenderAuthentication.TrustedStoreLocation, "Peer.MessageSenderAuthentication.TrustedStoreLocation");
313 Assert.AreEqual ("CustomCertificateValidatorType", element.IssuedTokenAuthentication.CustomCertificateValidatorType, "IssuedTokenAuthentication.CustomCertificateValidatorType");
314 Assert.AreEqual (X509CertificateValidationMode.PeerOrChainTrust, element.IssuedTokenAuthentication.CertificateValidationMode, "IssuedTokenAuthentication.CustomCertificateValidatorType");
315 Assert.AreEqual (X509RevocationMode.Offline, element.IssuedTokenAuthentication.RevocationMode, "IssuedTokenAuthentication.RevocationMode");
316 Assert.AreEqual (StoreLocation.CurrentUser, element.IssuedTokenAuthentication.TrustedStoreLocation, "IssuedTokenAuthentication.TrustedStoreLocation");
317 Assert.AreEqual ("SalmSerializerType", element.IssuedTokenAuthentication.SamlSerializerType, "IssuedTokenAuthentication.SamlSerializerType");
318 Assert.AreEqual (true, element.IssuedTokenAuthentication.AllowUntrustedRsaIssuers, "IssuedTokenAuthentication.AllowUntrustedRsaIssuers");
320 Assert.AreEqual ("FindValue", element.IssuedTokenAuthentication.KnownCertificates [0].FindValue, "IssuedTokenAuthentication.KnownCertificates[0].FindValue");
321 Assert.AreEqual (StoreLocation.CurrentUser, element.IssuedTokenAuthentication.KnownCertificates [0].StoreLocation, "IssuedTokenAuthentication.KnownCertificates[0].StoreLocation");
322 Assert.AreEqual (StoreName.Root, element.IssuedTokenAuthentication.KnownCertificates [0].StoreName, "IssuedTokenAuthentication.KnownCertificates[0].StoreName");
323 Assert.AreEqual (X509FindType.FindByIssuerName, element.IssuedTokenAuthentication.KnownCertificates [0].X509FindType, "IssuedTokenAuthentication.KnownCertificates[0].X509FindType");
325 Assert.AreEqual ("SecurityStateEncoderType", element.SecureConversationAuthentication.SecurityStateEncoderType, "SecureConversationAuthentication.SecurityStateEncoderType");
329 public void ServiceCredentialsElement_defaults () {
330 ServiceCredentialsElement element = new ServiceCredentialsElement ();
332 Assert.AreEqual (typeof (ServiceCredentials), element.BehaviorType, "BehaviorType");
333 Assert.AreEqual ("serviceCredentials", element.ConfigurationElementName, "ConfigurationElementName");
335 Assert.AreEqual (String.Empty, element.Type, "Type");
337 Assert.AreEqual (String.Empty, element.ClientCertificate.Certificate.FindValue, "ClientCertificate.Certificate.FindValue");
338 Assert.AreEqual (StoreLocation.LocalMachine, element.ClientCertificate.Certificate.StoreLocation, "ClientCertificate.Certificate.StoreLocation");
339 Assert.AreEqual (StoreName.My, element.ClientCertificate.Certificate.StoreName, "ClientCertificate.Certificate.StoreName");
340 Assert.AreEqual (X509FindType.FindBySubjectDistinguishedName, element.ClientCertificate.Certificate.X509FindType, "ClientCertificate.Certificate.X509FindType");
342 Assert.AreEqual (String.Empty, element.ClientCertificate.Authentication.CustomCertificateValidatorType, "ClientCertificate.Authentication.CustomCertificateValidatorType");
343 Assert.AreEqual (X509CertificateValidationMode.ChainTrust, element.ClientCertificate.Authentication.CertificateValidationMode, "ClientCertificate.Authentication.CustomCertificateValidatorType");
344 Assert.AreEqual (X509RevocationMode.Online, element.ClientCertificate.Authentication.RevocationMode, "ClientCertificate.Authentication.RevocationMode");
345 Assert.AreEqual (StoreLocation.LocalMachine, element.ClientCertificate.Authentication.TrustedStoreLocation, "ClientCertificate.Authentication.TrustedStoreLocation");
346 Assert.AreEqual (true, element.ClientCertificate.Authentication.IncludeWindowsGroups, "ClientCertificate.Authentication.IncludeWindowsGroups");
347 Assert.AreEqual (false, element.ClientCertificate.Authentication.MapClientCertificateToWindowsAccount, "ClientCertificate.Authentication.MapClientCertificateToWindowsAccount");
349 Assert.AreEqual (String.Empty, element.ServiceCertificate.FindValue, "ServiceCertificate.FindValue");
350 Assert.AreEqual (StoreLocation.LocalMachine, element.ServiceCertificate.StoreLocation, "ServiceCertificate.StoreLocation");
351 Assert.AreEqual (StoreName.My, element.ServiceCertificate.StoreName, "ServiceCertificate.StoreName");
352 Assert.AreEqual (X509FindType.FindBySubjectDistinguishedName, element.ServiceCertificate.X509FindType, "ServiceCertificate.X509FindType");
354 Assert.AreEqual (UserNamePasswordValidationMode.Windows, element.UserNameAuthentication.UserNamePasswordValidationMode, "UserNameAuthentication.UserNamePasswordValidationMode");
355 Assert.AreEqual (true, element.UserNameAuthentication.IncludeWindowsGroups, "UserNameAuthentication.IncludeWindowsGroups");
356 Assert.AreEqual (String.Empty, element.UserNameAuthentication.MembershipProviderName, "UserNameAuthentication.MembershipProviderName");
357 Assert.AreEqual (String.Empty, element.UserNameAuthentication.CustomUserNamePasswordValidatorType, "UserNameAuthentication.customUserNamePasswordValidatorType");
358 Assert.AreEqual (false, element.UserNameAuthentication.CacheLogonTokens, "UserNameAuthentication.CacheLogonTokens");
359 Assert.AreEqual (128, element.UserNameAuthentication.MaxCachedLogonTokens, "UserNameAuthentication.MaxCachedLogonTokens");
360 Assert.AreEqual (new TimeSpan (0, 15, 0), element.UserNameAuthentication.CachedLogonTokenLifetime, "UserNameAuthentication.CachedLogonTokenLifetime");
362 Assert.AreEqual (String.Empty, element.Peer.Certificate.FindValue, "Peer.Certificate.FindValue");
363 Assert.AreEqual (StoreLocation.CurrentUser, element.Peer.Certificate.StoreLocation, "Peer.Certificate.StoreLocation");
364 Assert.AreEqual (StoreName.My, element.Peer.Certificate.StoreName, "Peer.Certificate.StoreName");
365 Assert.AreEqual (X509FindType.FindBySubjectDistinguishedName, element.Peer.Certificate.X509FindType, "Peer.Certificate.X509FindType");
367 Assert.AreEqual (String.Empty, element.Peer.PeerAuthentication.CustomCertificateValidatorType, "Peer.Authentication.CustomCertificateValidatorType");
368 Assert.AreEqual (X509CertificateValidationMode.PeerOrChainTrust, element.Peer.PeerAuthentication.CertificateValidationMode, "Peer.Authentication.CustomCertificateValidatorType");
369 Assert.AreEqual (X509RevocationMode.Online, element.Peer.PeerAuthentication.RevocationMode, "Peer.Authentication.RevocationMode");
370 Assert.AreEqual (StoreLocation.CurrentUser, element.Peer.PeerAuthentication.TrustedStoreLocation, "Peer.Authentication.TrustedStoreLocation");
372 Assert.AreEqual (String.Empty, element.Peer.MessageSenderAuthentication.CustomCertificateValidatorType, "Peer.MessageSenderAuthentication.CustomCertificateValidatorType");
373 Assert.AreEqual (X509CertificateValidationMode.PeerOrChainTrust, element.Peer.MessageSenderAuthentication.CertificateValidationMode, "Peer.MessageSenderAuthentication.CustomCertificateValidatorType");
374 Assert.AreEqual (X509RevocationMode.Online, element.Peer.MessageSenderAuthentication.RevocationMode, "Peer.MessageSenderAuthentication.RevocationMode");
375 Assert.AreEqual (StoreLocation.CurrentUser, element.Peer.MessageSenderAuthentication.TrustedStoreLocation, "Peer.MessageSenderAuthentication.TrustedStoreLocation");
377 Assert.AreEqual (String.Empty, element.IssuedTokenAuthentication.CustomCertificateValidatorType, "IssuedTokenAuthentication.CustomCertificateValidatorType");
378 Assert.AreEqual (X509CertificateValidationMode.ChainTrust, element.IssuedTokenAuthentication.CertificateValidationMode, "IssuedTokenAuthentication.CustomCertificateValidatorType");
379 Assert.AreEqual (X509RevocationMode.Online, element.IssuedTokenAuthentication.RevocationMode, "IssuedTokenAuthentication.RevocationMode");
380 Assert.AreEqual (StoreLocation.LocalMachine, element.IssuedTokenAuthentication.TrustedStoreLocation, "IssuedTokenAuthentication.TrustedStoreLocation");
381 Assert.AreEqual (String.Empty, element.IssuedTokenAuthentication.SamlSerializerType, "IssuedTokenAuthentication.SamlSerializerType");
382 Assert.AreEqual (false, element.IssuedTokenAuthentication.AllowUntrustedRsaIssuers, "IssuedTokenAuthentication.AllowUntrustedRsaIssuers");
384 Assert.AreEqual (0, element.IssuedTokenAuthentication.KnownCertificates.Count, "IssuedTokenAuthentication.KnownCertificates.Count");
386 Assert.AreEqual (String.Empty, element.SecureConversationAuthentication.SecurityStateEncoderType, "SecureConversationAuthentication.SecurityStateEncoderType");