public void ServiceAuthorizationElement_default()
        {
            ServiceAuthorizationElement serviceAuthorization = new ServiceAuthorizationElement();

            Assert.AreEqual(typeof(ServiceAuthorizationBehavior), serviceAuthorization.BehaviorType, "BehaviorType");
            Assert.AreEqual("serviceAuthorization", serviceAuthorization.ConfigurationElementName, "ConfigurationElementName");

            Assert.AreEqual(String.Empty, serviceAuthorization.RoleProviderName, "RoleProviderName");
            Assert.AreEqual(PrincipalPermissionMode.UseWindowsGroups, serviceAuthorization.PrincipalPermissionMode, "PrincipalPermissionMode");
            Assert.AreEqual(false, serviceAuthorization.ImpersonateCallerForAllOperations, "ImpersonateCallerForAllOperations");
            Assert.AreEqual(String.Empty, serviceAuthorization.ServiceAuthorizationManagerType, "ServiceAuthorizationManagerType");

            Assert.AreEqual(0, serviceAuthorization.AuthorizationPolicies.Count, "AuthorizationPolicies.Count");
        }
        public void ServiceAuthorizationElement()
        {
            ServiceBehaviorElement      behavior             = OpenConfig();
            ServiceAuthorizationElement serviceAuthorization = (ServiceAuthorizationElement)behavior [typeof(ServiceAuthorizationElement)];

            if (serviceAuthorization == null)
            {
                Assert.Fail("ServiceAuthorizationElement is not exist in collection.");
            }

            Assert.AreEqual(typeof(ServiceAuthorizationBehavior), serviceAuthorization.BehaviorType, "BehaviorType");
            Assert.AreEqual("serviceAuthorization", serviceAuthorization.ConfigurationElementName, "ConfigurationElementName");

            Assert.AreEqual("RoleProvider", serviceAuthorization.RoleProviderName, "RoleProviderName");
            Assert.AreEqual(PrincipalPermissionMode.UseAspNetRoles, serviceAuthorization.PrincipalPermissionMode, "PrincipalPermissionMode");
            Assert.AreEqual(true, serviceAuthorization.ImpersonateCallerForAllOperations, "ImpersonateCallerForAllOperations");
            Assert.AreEqual("SerAuthManagType", serviceAuthorization.ServiceAuthorizationManagerType, "ServiceAuthorizationManagerType");

            Assert.AreEqual(2, serviceAuthorization.AuthorizationPolicies.Count, "AuthorizationPolicies.Count");
            Assert.AreEqual("PolicyType1", serviceAuthorization.AuthorizationPolicies [0].PolicyType, "AuthorizationPolicies[0].PolicyType");
            Assert.AreEqual("PolicyType2", serviceAuthorization.AuthorizationPolicies [1].PolicyType, "AuthorizationPolicies[1].PolicyType");
        }