public void DoTests() { int hr = 0; Config(); string savedTuneRequest; hr = xmlUtility.Serialize(dvbtr, out savedTuneRequest); DsError.ThrowExceptionForHR(hr); object o; // Only test the string version of the method but it's the more conveniant for a .Net usage. hr = xmlUtility.Deserialize(savedTuneRequest, out o); DsError.ThrowExceptionForHR(hr); Debug.Assert(o is IDVBTuneRequest); IDVBTuneRequest dvbtr2 = (IDVBTuneRequest)o; int onid, tsid, sid; dvbtr2.get_ONID(out onid); dvbtr2.get_TSID(out tsid); dvbtr2.get_SID(out sid); Debug.Assert((onid == 8442) && (tsid == 1) && (sid == 259)); }
public void DoTests() { int hr = 0; Config(); object xmlNode; // Save the tune request hr = ptXml.Save(out xmlNode); DsError.ThrowExceptionForHR(hr); Debug.Assert(xmlNode is IXMLDOMNode); // Change the ONID in the saved string string conf = (xmlNode as IXMLDOMNode).xml; conf = conf.Replace("8442", "2448"); // Load the modified setting hr = ptXml.Load(conf); DsError.ThrowExceptionForHR(hr); int onid; hr = dvbtr.get_ONID(out onid); DsError.ThrowExceptionForHR(hr); Debug.Assert(onid == 2448); // As documented, this method doesn't seem to do anything hr = ptXml.InitNew(); DsError.ThrowExceptionForHR(hr); }