public void HttpParameterDescriptionCollection_Synchronized_Implements_Clear() { OperationDescription od1 = GetOperationDescription(typeof(MockService3), "SampleInOutMethod"); MessagePartDescriptionCollection mpdColl = od1.Messages[0].Body.Parts; Assert.AreEqual(2, mpdColl.Count, "MessagePartDescriptionCollection should show 2 existing input parameters"); // This ctor creates the synchronized form of the collection. It should immediately reflect // the state of the MPD collection HttpParameterDescriptionCollection hpdColl = new HttpParameterDescriptionCollection(od1, isOutputCollection: false); hpdColl.Clear(); Assert.AreEqual(0, hpdColl.Count, "Clear failed"); }
public void HttpParameterDescriptionCollection_Synchronized_Incomplete_Implements_Clear() { OperationDescription od = GetOperationDescription(typeof(MockService3), "SampleInOutMethod"); od.Messages.Clear(); HttpParameterDescriptionCollection hpdColl = new HttpParameterDescriptionCollection(od, isOutputCollection: false); hpdColl.Clear(); Assert.AreEqual(0, hpdColl.Count, "Clear failed"); }
public void HttpParameterDescriptionCollection_Unsynchronized_Implements_Clear() { HttpParameterDescriptionCollection coll = new HttpParameterDescriptionCollection(); HttpParameterDescription hpd1 = new HttpParameterDescription() { Name = "First", Namespace = "FirstNS", Index = 0, ParameterType = typeof(string) }; HttpParameterDescription hpd2 = new HttpParameterDescription() { Name = "Second", Namespace = "SecondNS", Index = 1, ParameterType = typeof(int) }; coll.Add(hpd1); coll.Add(hpd2); // Clear coll.Clear(); Assert.AreEqual(0, coll.Count, "Clear failed"); }