Пример #1
0
        public void responseEnvelopeConstruction()
        {
            Dictionary <string, string> response = new Dictionary <string, string>();

            response.Add("responseEnvelope.timestamp", "2011-05-11T22%3A05%3A33.962-07%3A00");
            response.Add("responseEnvelope.correlationId", "b1985a21862fe");
            response.Add("responseEnvelope.build", "1877082");

            ResponseEnvelope env = ResponseEnvelope.CreateInstance(response, "responseEnvelope.", -1);

            Assert.AreEqual("2011-05-11T22%3A05%3A33.962-07%3A00", env.timestamp);
            Assert.AreEqual(null, env.ack);
            Assert.AreEqual("b1985a21862fe", env.correlationId);
            Assert.AreEqual("1877082", env.build);

            response.Add("responseEnvelope.ack", "Failure");
            env = ResponseEnvelope.CreateInstance(response, "responseEnvelope.", -1);
            Assert.AreEqual("2011-05-11T22%3A05%3A33.962-07%3A00", env.timestamp);
            Assert.AreEqual(AckCode.FAILURE, env.ack);
            Assert.AreEqual("b1985a21862fe", env.correlationId);
            Assert.AreEqual("1877082", env.build);
        }