コード例 #1
0
        public void MoveRule()
        {
            string expected = File.ReadAllText(Path.Combine(_requestsTestDataPath, "MoveRule.xml"));
            var    request  = new MoveRule
            {
                SessionId = "sid",
                Who       = "*****@*****.**",
                RuleID    = 1,
                MoveType  = TRuleMoveType.Down
            };
            var xml = request.ToXml().InnerXmlFormatted();

            Assert.AreEqual(expected, xml);

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(File.ReadAllText(Path.Combine(_responsesTestDataPath, "MoveRule.xml")));
            var response = request.FromHttpRequestResult(new HttpRequestResult {
                Response = doc.InnerXml
            });

            Assert.AreEqual("result", response.Type);
            Assert.True(response.Success);
        }