public void TestToMsrFromTUResponseDeserializeMethod() { var xmlCurrentDoc = new XmlDocument(); xmlCurrentDoc.Load($"{Context.XMLMessagePath}{ToMsrFromTUResponse.NameForESB}.xml"); var messageObj = SerializationTools.DeserialiseDataContract <ToMsrFromTUResponse>(xmlCurrentDoc.OuterXml); var originalMessageObj = SynchronizationTestHelper.GetToMsrFromTUMessage(); Assert.AreEqual(messageObj.RequestInfo, originalMessageObj.RequestInfo); Assert.AreEqual(messageObj.Items.FirstOrDefault()?.Beneficiary?.Guid, originalMessageObj.Items.FirstOrDefault()?.Beneficiary?.Guid); Assert.AreEqual(messageObj.Items.LastOrDefault()?.ChlenSemi.Guid, originalMessageObj.Items.LastOrDefault()?.ChlenSemi.Guid); }
public void TestToMsrFromTUResponseSerializeMethod() { var testMsg = SynchronizationTestHelper.GetToMsrFromTUMessage(); var xmlStringMsg = SerializationTools.SerializeDataContract(testMsg); var xmlCurrentDoc = new XmlDocument(); xmlCurrentDoc.LoadXml(xmlStringMsg); xmlCurrentDoc.DocumentElement?.SetAttribute("xmlns", "http://eais.com/tomsrfromtu.xsd"); xmlCurrentDoc.Save($"{Context.XMLMessagePath}{ToMsrFromTUResponse.NameForESB}.xml"); var xmlTemplateDoc = new XmlDocument(); xmlTemplateDoc.Load($"{Context.XMLMessagePath}{ToMsrFromTUResponse.NameForESB}Template.xml"); Assert.AreEqual(xmlCurrentDoc.OuterXml, xmlTemplateDoc.OuterXml); }