コード例 #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 TestToReestrMspFromMsrCatalogItemsRequestSerializeMethod()
        {
            var testMsg = SynchronizationTestHelper.GetToReestrMspFromMsrCatalogItemsRequestMessage();

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

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

            var xmlTemplateDoc = new XmlDocument();

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

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