Exemplo n.º 1
0
        public void TestToMsrFromReestrMspCatalogDataSerializeMethod()
        {
            var testMsg = SynchronizationTestHelper.GetToMsrFromReestrMspCatalogDataMessage();

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

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

            var xmlTemplateDoc = new XmlDocument();

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

            Assert.AreEqual(xmlCurrentDoc.OuterXml, xmlTemplateDoc.OuterXml);
        }
Exemplo n.º 2
0
        public void TestToMsrFromReestrMspCatalogDataDeserializeMethod()
        {
            var xmlCurrentDoc = new XmlDocument();

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

            var messageObj =
                SerializationTools
                .DeserialiseDataContract <ToMsrFromReestrMspCatalogDataChanges>(xmlCurrentDoc.OuterXml);
            var originalMessageObj = SynchronizationTestHelper.GetToMsrFromReestrMspCatalogDataMessage();

            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);
        }