public void PolicyImporters_DefaultConfiguration() { ServiceModelSectionGroup config = OpenConfig("empty"); PolicyImporterElementCollection col = config.Client.Metadata.PolicyImporters; Type [] types = new Type [] { typeof(CompositeDuplexBindingElementImporter), typeof(MessageEncodingBindingElementImporter), typeof(OneWayBindingElementImporter), typeof(PrivacyNoticeBindingElementImporter), typeof(ReliableSessionBindingElementImporter), typeof(SecurityBindingElementImporter), typeof(TransactionFlowBindingElementImporter), typeof(TransportBindingElementImporter), typeof(UseManagedPresentationBindingElementImporter) }; foreach (Type type in types) { PolicyImporterElement item = col [type.AssemblyQualifiedName]; if (item == null) { Assert.Fail(type.Name + " not exists"); } Assert.AreEqual(type.AssemblyQualifiedName, item.Type, type.Name); } }
public void PolicyImporters() { ServiceModelSectionGroup config = OpenConfig("client.metadata"); PolicyImporterElementCollection col = config.Client.Metadata.PolicyImporters; Assert.AreEqual(2, col.Count, "Count"); PolicyImporterElement item = col ["PolicyImporterType1"]; if (item == null) { Assert.Fail("PolicyImporterType1 not exists"); } Assert.AreEqual("PolicyImporterType1", item.Type, "PolicyImporterType1.Type"); item = col ["PolicyImporterType2"]; if (item == null) { Assert.Fail("PolicyImporterType2 not exists"); } Assert.AreEqual("PolicyImporterType2", item.Type, "PolicyImporterType2.Type"); }