コード例 #1
0
        public void TestToMsrFromReestrMspMergeItemsSerializeMethod()
        {
            var testMsg = SynchronizationTestHelper.GetToMsrFromReestrMspMergeItemsMessage();

            var xmlStringMsg  = testMsg.Serialize(true);
            var xmlCurrentDoc = new XmlDocument();

            xmlCurrentDoc.LoadXml(xmlStringMsg);
            xmlCurrentDoc.Save($"{Context.XMLMessagePath}{ToMsrFromReestrMspMergedItemsResponse.NameForESB}.xml");

            var xmlTemplateDoc = new XmlDocument();

            xmlTemplateDoc.Load($"{Context.XMLMessagePath}{ToMsrFromReestrMspMergedItemsResponse.NameForESB}Template.xml");

            Assert.AreEqual(xmlCurrentDoc.OuterXml, xmlTemplateDoc.OuterXml);
        }
コード例 #2
0
        public void TestToMsrFromReestrMspMergedItemsResponseDeserializeMethod()
        {
            var xmlCurrentDoc = new XmlDocument();

            xmlCurrentDoc.Load($"{Context.XMLMessagePath}{ToMsrFromReestrMspMergedItemsResponse.NameForESB}.xml");

            var messageObj =
                SerializationTools.DeserialiseDataContract <ToMsrFromReestrMspMergedItemsResponse>(
                    xmlCurrentDoc.OuterXml);
            var originalMessageObj = SynchronizationTestHelper.GetToMsrFromReestrMspMergeItemsMessage();

            Assert.AreEqual(messageObj.RequestInfo, originalMessageObj.RequestInfo);
            Assert.AreEqual(messageObj.Items.FirstOrDefault()?.Beneficiary?.Guid,
                            originalMessageObj.Items.FirstOrDefault()?.Beneficiary?.Guid);
            Assert.AreEqual(messageObj.Items.FirstOrDefault()?.Sources.FirstOrDefault()?.Key,
                            originalMessageObj.Items.FirstOrDefault()?.Sources.FirstOrDefault()?.Key);
        }