コード例 #1
0
        public void TestToMsrFromReestrMspCatalogItemsResponseDeserializeMethod()
        {
            var xmlCurrentDoc = new XmlDocument();

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

            var messageObj =
                SerializationTools.DeserialiseDataContract <ToMsrFromReestrMspCatalogItemsResponse>(xmlCurrentDoc
                                                                                                    .OuterXml);
            var originalMessageObj = SynchronizationTestHelper.GetToMsrFromReestrMspCatalogItemsResponseMessage();

            Assert.AreEqual(messageObj.RequestInfo, originalMessageObj.RequestInfo);
            Assert.AreEqual(messageObj.Items.FirstOrDefault()?.Classifier.Guid,
                            originalMessageObj.Items.FirstOrDefault()?.Classifier.Guid);
            Assert.AreEqual(messageObj.Items.FirstOrDefault()?.Classifier.Category.Name,
                            originalMessageObj.Items.FirstOrDefault()?.Classifier.Category.Name);
        }
コード例 #2
0
        public void TestToMsrFromReestrMspCatalogItemsResponseSerializeMethod()
        {
            var testMsg = SynchronizationTestHelper.GetToMsrFromReestrMspCatalogItemsResponseMessage();

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

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

            var xmlTemplateDoc = new XmlDocument();

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

            Assert.AreEqual(xmlCurrentDoc.OuterXml, xmlTemplateDoc.OuterXml);
        }