public void EnableNotificationsTest() { string id = "1"; string userID = "2"; string screenName = "JoeMayo"; XElement expected = XElement.Parse(m_testUserQueryResponse); Expect.Once.On(m_twitterExecute) .Method("ExecuteTwitter") .Will(Return.Value(expected)); User actual = m_ctx.EnableNotifications(id, userID, screenName); Assert.AreEqual(expected.Element("name").Value, actual.Name); }
/// <summary> /// Shows how to do a Notifications Follow /// </summary> /// <param name="twitterCtx">TwitterContext</param> private static void EnableNotificationsWithScreenNameDemo(TwitterContext twitterCtx) { var user = twitterCtx.EnableNotifications(null, null, "JoeMayo"); if (user == null) { return; } Console.WriteLine("User Name: " + user.Name); }
/// <summary> /// Shows how to do a Notifications Follow /// </summary> /// <param name="twitterCtx">TwitterContext</param> private static void EnableNotificationsWithUserIDDemo(TwitterContext twitterCtx) { var user = twitterCtx.EnableNotifications(null, "15411837", null); if (user == null) { return; } Console.WriteLine("User Name: " + user.Name); }
public void EnableNotificationsTest() { string id = "1"; string userID = "2"; string screenName = "JoeMayo"; User expected = new User(); var expectedList = new List <User> { expected }; Expect.Once.On(m_twitterExecute) .Method("ExecuteTwitter") .Will(Return.Value(expectedList)); User actual = m_ctx.EnableNotifications(id, userID, screenName); Assert.AreEqual(expected, actual); }