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

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

            var messageObj =
                SerializationTools.DeserialiseDataContract <ToReestrMspFromMsrCatalogItemsRequest>(xmlCurrentDoc.OuterXml);
            var originalMessageObj = SynchronizationTestHelper.GetToReestrMspFromMsrCatalogItemsRequestMessage();

            //TODO поправить по аналогии с TestToMsrFromReestrMspCatalogDataDeserializeMethod
            //Assert.IsFalse(message == null);
            Assert.AreEqual(messageObj.RequestInfo, originalMessageObj.RequestInfo);
            Assert.AreEqual(messageObj.Criteria.Type, originalMessageObj.Criteria.Type);

            for (int i = 0; i < messageObj.Criteria.Condition.Length; i++)
            {
                Assert.AreEqual(messageObj.Criteria.Condition[i].Attribute, originalMessageObj.Criteria.Condition[i].Attribute);
                Assert.AreEqual(messageObj.Criteria.Condition[i].Operator, originalMessageObj.Criteria.Condition[i].Operator);
                Assert.AreEqual(messageObj.Criteria.Condition[i].Value, originalMessageObj.Criteria.Condition[i].Value);
            }

            Assert.AreEqual(messageObj.Criteria.Criteria, originalMessageObj.Criteria.Criteria);
            Assert.AreEqual(messageObj.Sorting, originalMessageObj.Sorting);
            Assert.AreEqual(messageObj.Type, originalMessageObj.Type);
        }
コード例 #2
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);
        }
コード例 #3
0
        public void TestToTUFromMSRResponseDeserializeMethod()
        {
            var xmlCurrentDoc = new XmlDocument();

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

            var messageObj =
                SerializationTools.DeserialiseDataContract <ToTUFromMsrResponse>(xmlCurrentDoc.OuterXml);
            var originalMessageObj = SynchronizationTestHelper.GetToTUFromMsrResponseMessage();

            Assert.AreEqual(messageObj.RequestInfo, originalMessageObj.RequestInfo);
            Assert.AreEqual(messageObj.Items.FirstOrDefault()?.Territory?.Guid,
                            originalMessageObj.Items.FirstOrDefault()?.Territory?.Guid);
            Assert.AreEqual(messageObj.Items.LastOrDefault()?.TypeDocument?.Guid,
                            originalMessageObj.Items.LastOrDefault()?.TypeDocument?.Guid);
        }
コード例 #4
0
        public void TestToTUFromMSRResponseSerializeMethod()
        {
            var testMsg = SynchronizationTestHelper.GetToTUFromMsrResponseMessage();

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

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

            var xmlTemplateDoc = new XmlDocument();

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

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

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

            var messageObj =
                SerializationTools.DeserialiseDataContract <ToMsrFromReestrMspFiasItemsResponse>(xmlCurrentDoc.OuterXml);
            var originalMessageObj = SynchronizationTestHelper.GetToMsrFromReestrMspFiasItemsMessage();

            Assert.AreEqual(messageObj.RequestInfo, originalMessageObj.RequestInfo);
            Assert.AreEqual(messageObj.Items.FirstOrDefault()?.FiasAddressObjects.AOGUID,
                            originalMessageObj.Items.FirstOrDefault()?.FiasAddressObjects.AOGUID);
            Assert.AreEqual(messageObj.Items.LastOrDefault()?.FiasHousesStructures.AOGUID,
                            originalMessageObj.Items.LastOrDefault()?.FiasHousesStructures.AOGUID);
        }
コード例 #6
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);
        }
コード例 #7
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);
        }
コード例 #8
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);
        }
コード例 #9
0
        public void TestToMsrFromTUResponseSerializeMethod()
        {
            var testMsg = SynchronizationTestHelper.GetToMsrFromTUMessage();

            var xmlStringMsg  = SerializationTools.SerializeDataContract(testMsg);
            var xmlCurrentDoc = new XmlDocument();

            xmlCurrentDoc.LoadXml(xmlStringMsg);
            xmlCurrentDoc.DocumentElement?.SetAttribute("xmlns", "http://eais.com/tomsrfromtu.xsd");
            xmlCurrentDoc.Save($"{Context.XMLMessagePath}{ToMsrFromTUResponse.NameForESB}.xml");

            var xmlTemplateDoc = new XmlDocument();

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

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