示例#1
0
        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);
        }
示例#2
0
        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);
        }