public void TestUnknownHeaders() { ConverterServiceExtraTest et = new ConverterServiceExtraTest(); et.Url = "http://localhost:8080/ConvDocEncWra.asmx"; et.myUserInfo = new MyUserInfo(); et.myUserInfo.userId = 5; et.myUserInfo.Actor = "hi"; et.TestUnknownHeader1(); et.TestUnknownHeader2(); int res = et.TestUnknownHeader3(); Assert.AreEqual(5, res, "TestUnknownHeader3"); res = et.TestUnknownHeader4(); Assert.AreEqual(5, res, "TestUnknownHeader4"); }
public void TestObjectReturn() { ConverterServiceExtraTest et = new ConverterServiceExtraTest(); // Test the Discover method. et.Url = "http://localhost:8080/ConvDocEncWra.asmx?disco"; et.Discover(); string d; object res = et.GetTestInfo("hi", out d); Assert.AreEqual("iii", d, "t1"); Assert.IsNotNull(res, "t2"); Assert.IsTrue(res is XmlNode[], "t3"); XmlNode[] nods = res as XmlNode[]; Assert.AreEqual(5, nods.Length, "t4"); Assert.IsTrue(nods[0] is XmlAttribute, "t5"); XmlAttribute at = nods[0] as XmlAttribute; Assert.AreEqual("id", at.LocalName, "t6"); Assert.IsTrue(nods[1] is XmlAttribute, "t7"); at = nods[1] as XmlAttribute; Assert.AreEqual("type", at.LocalName, "t8"); Assert.IsTrue(nods[2] is XmlAttribute, "t9"); at = nods[2] as XmlAttribute; Assert.IsTrue(nods[3] is XmlElement, "t10"); XmlElement el = nods[3] as XmlElement; Assert.AreEqual("a", el.Name, "t11"); Assert.IsTrue(nods[4] is XmlElement, "t12"); el = nods[4] as XmlElement; Assert.AreEqual("b", el.Name, "t13"); }
public void TestUnknownHeaders () { ConverterServiceExtraTest et = new ConverterServiceExtraTest (); et.Url = "http://localhost:8080/ConvDocEncWra.asmx"; et.myUserInfo = new MyUserInfo (); et.myUserInfo.userId = 5; et.myUserInfo.Actor = "hi"; et.TestUnknownHeader1 (); et.TestUnknownHeader2 (); int res = et.TestUnknownHeader3 (); Assert.AreEqual (5, res, "TestUnknownHeader3"); res = et.TestUnknownHeader4 (); Assert.AreEqual (5, res, "TestUnknownHeader4"); }
public void TestObjectReturn () { ConverterServiceExtraTest et = new ConverterServiceExtraTest (); // Test the Discover method. et.Url = "http://localhost:8080/ConvDocEncWra.asmx?disco"; et.Discover (); string d; object res = et.GetTestInfo ("hi", out d); Assert.AreEqual ("iii", d, "t1"); Assert.IsNotNull (res, "t2"); Assert.IsTrue (res is XmlNode[], "t3"); XmlNode[] nods = res as XmlNode[]; Assert.AreEqual (5, nods.Length, "t4"); Assert.IsTrue (nods[0] is XmlAttribute, "t5"); XmlAttribute at = nods[0] as XmlAttribute; Assert.AreEqual ("id", at.LocalName, "t6"); Assert.IsTrue (nods[1] is XmlAttribute, "t7"); at = nods[1] as XmlAttribute; Assert.AreEqual ("type", at.LocalName, "t8"); Assert.IsTrue (nods[2] is XmlAttribute, "t9"); at = nods[2] as XmlAttribute; Assert.IsTrue (nods[3] is XmlElement, "t10"); XmlElement el = nods[3] as XmlElement; Assert.AreEqual ("a", el.Name, "t11"); Assert.IsTrue (nods[4] is XmlElement, "t12"); el = nods[4] as XmlElement; Assert.AreEqual ("b", el.Name, "t13"); }