public void Lab5_GreyWarden_Serialize_Doc_2() { var xmlDocSerializer = new XmlDocumentSerializer(); var hdd = fixture.Create <Hdd>(); var xmlDoc = xmlDocSerializer.Serialize(hdd); var resultHdd = xmlDocSerializer.Deserialize <Hdd>(xmlDoc); Assert.AreEqual(hdd.Capacity, resultHdd.Capacity); Assert.AreEqual(hdd.Interface, resultHdd.Interface); Assert.AreEqual(hdd.RecordingSpeed, resultHdd.RecordingSpeed); }
public void Lab5_GreyWarden_Serialize_Doc_3() { var xmlDocSerializer = new XmlDocumentSerializer(); var list = new List <Hdd> { fixture.Create <Hdd>() }; var xmlDoc = xmlDocSerializer.Serialize(list); var resultList = xmlDocSerializer.Deserialize <List <Hdd> >(xmlDoc); Assert.AreEqual(list[0].Capacity, resultList[0].Capacity); Assert.AreEqual(list[0].Interface, resultList[0].Interface); Assert.AreEqual(list[0].RecordingSpeed, resultList[0].RecordingSpeed); }
public void Lab5_GreyWarden_Serialize_Doc_1() { var xmlDocSerializer = new XmlDocumentSerializer(); var hdd = fixture.Create <Hdd>(); var xmlDoc = xmlDocSerializer.Serialize(hdd); var capacity = xmlDoc.GetElementsByTagName("Capacity"); Assert.IsTrue(capacity.Count > 0 && capacity[0].InnerText == hdd.Capacity.ToString()); var hddInterface = xmlDoc.GetElementsByTagName("Interface"); Assert.IsTrue(hddInterface.Count > 0 && hddInterface[0].InnerText == hdd.Interface); var recordingSpeed = xmlDoc.GetElementsByTagName("RecordingSpeed"); Assert.IsTrue(recordingSpeed.Count > 0 && recordingSpeed[0].InnerText == hdd.RecordingSpeed.ToString()); }