public void TestToReestrMspFromMsrDataChangesDeserializeMethod() { var xmlCurrentDoc = new XmlDocument(); xmlCurrentDoc.Load($"{Context.XMLMessagePath}{ToReestrMspFromMsrDataChanges.NameForESB}.xml"); var messageObj = SerializationTools.DeserialiseDataContract <ToReestrMspFromMsrDataChanges>(xmlCurrentDoc.OuterXml); var originalMessageObj = SynchronizationTestHelper.GetToReestrMspFromMsrDataChangesMessage(); Assert.AreEqual(messageObj.RequestInfo, originalMessageObj.RequestInfo); Assert.AreEqual(messageObj.Items.FirstOrDefault()?.Beneficiary.Registration.Guid, originalMessageObj.Items.FirstOrDefault()?.Beneficiary.Registration.Guid); Assert.AreEqual(messageObj.Items.FirstOrDefault()?.Beneficiary.Location.Street.Territory.FIAS, originalMessageObj.Items.FirstOrDefault()?.Beneficiary.Location.Street.Territory.FIAS); }
public void TestToReestrMspFromMsrDataChangesSerializeMethod() { var testMsg = SynchronizationTestHelper.GetToReestrMspFromMsrDataChangesMessage(); var xmlStringMsg = testMsg.Serialize(true); var xmlCurrentDoc = new XmlDocument(); xmlCurrentDoc.LoadXml(xmlStringMsg); xmlCurrentDoc.Save($"{Context.XMLMessagePath}{ToReestrMspFromMsrDataChanges.NameForESB}.xml"); var xmlTemplateDoc = new XmlDocument(); xmlTemplateDoc.Load($"{Context.XMLMessagePath}{ToReestrMspFromMsrDataChanges.NameForESB}Template.xml"); Assert.AreEqual(xmlCurrentDoc.OuterXml, xmlTemplateDoc.OuterXml); }