Esempio n. 1
0
        public void DestroyDirectMessageTest()
        {
            string   id       = "1";
            XElement expected = XElement.Parse(m_testDirectMessageQueryResponse);

            Expect.Once.On(m_twitterExecute)
            .Method("ExecuteTwitter")
            .Will(Return.Value(expected));

            DirectMessage actual = m_ctx.DestroyDirectMessage(id);

            Assert.AreEqual(expected.Element("id").Value, actual.ID.ToString());
        }
Esempio n. 2
0
        public void DestroyDirectMessageTest()
        {
            string        id           = "1";
            DirectMessage expected     = new DirectMessage();
            var           expectedList =
                new List <DirectMessage>
            {
                expected
            };

            Expect.Once.On(m_twitterExecute)
            .Method("ExecuteTwitter")
            .Will(Return.Value(expectedList));
            DirectMessage actual = m_ctx.DestroyDirectMessage(id);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        /// <summary>
        /// shows how to delete a direct message
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        private static void DestroyDirectMessageDemo(TwitterContext twitterCtx)
        {
            var message = twitterCtx.DestroyDirectMessage("96404341");

            if (message != null)
            {
                Console.WriteLine(
                    "Recipient: {0}, Message: {1}",
                    message.RecipientScreenName,
                    message.Text);
            }
        }