/// <summary> /// Shows how to end the session for the current account /// </summary> /// <param name="twitterCtx"></param> private static void EndSession(TwitterContext twitterCtx) { var endSessionStatus = twitterCtx.EndAccountSession(); Console.WriteLine( "Request: {0}, Error: {1}", endSessionStatus.Request, endSessionStatus.Error); }
public void EndAccountSessionTest() { XElement expected = XElement.Parse(m_testEndSessionResponse); Expect.Once.On(m_twitterExecute) .Method("ExecuteTwitter") .Will(Return.Value(expected)); TwitterHashResponse actual = m_ctx.EndAccountSession(); Assert.AreEqual(expected.Element("error").Value, actual.Error); }
public void EndAccountSessionTest() { TwitterHashResponse expected = new TwitterHashResponse { Error = "Session Ended", Request = "http://twitter.com" }; Account acct = new Account { EndSessionStatus = expected }; var expectedList = new List <Account> { acct }; Expect.Once.On(m_twitterExecute) .Method("ExecuteTwitter") .Will(Return.Value(expectedList)); TwitterHashResponse actual = m_ctx.EndAccountSession(); Assert.AreEqual(expected, actual); }