コード例 #1
0
        public void UserConfiguration()
        {
            ServiceModelSectionGroup config = (ServiceModelSectionGroup)ConfigurationManager.OpenExeConfiguration("Test/config/userBinding").GetSectionGroup("system.serviceModel");

            BindingsSection section = config.Bindings;

            BindingCollectionElement collectionElement = section ["userBinding"];

            Assert.AreEqual(typeof(UserBindingCollectionElement), collectionElement.GetType(), "type");

            StandardBindingElementCollection <UserBindingElement> userBindings = ((UserBindingCollectionElement)collectionElement).Bindings;

            Assert.AreEqual(2, userBindings.Count, "Count");

            Assert.AreEqual("UserBinding_1", userBindings [0].Name, "Name_1");
            Assert.AreEqual("UserBinding_2", userBindings [1].Name, "Name_2");
        }
コード例 #2
0
        public void CollectionType()
        {
            StandardBindingElementCollection <BasicHttpBindingElement> coll = new StandardBindingElementCollection <BasicHttpBindingElement> ();

            Assert.AreEqual(ConfigurationElementCollectionType.AddRemoveClearMap, coll.CollectionType, "CollectionType");
        }
コード例 #3
0
		public void CollectionType () {
			StandardBindingElementCollection<BasicHttpBindingElement> coll = new StandardBindingElementCollection<BasicHttpBindingElement> ();
			Assert.AreEqual (ConfigurationElementCollectionType.AddRemoveClearMap, coll.CollectionType, "CollectionType");
		}