Beispiel #1
0
        public void Authenticate()
        {
            string expected = File.ReadAllText(Path.Combine(_requestsTestDataPath, "Authenticate.xml"));
            var    request  = new Authenticate
            {
                AuthType        = TAuthType.Plain,
                Digest          = "digest",
                Email           = "email",
                Password        = "******",
                PersistentLogin = false
            };
            var xml = request.ToXml().InnerXmlFormatted();

            Assert.AreEqual(expected, xml);

            XmlDocument doc = new XmlDocument();

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

            Assert.AreEqual("result", response.Type);
            Assert.AreEqual("201602051125504026", response.SessionId);
        }