public void BuildURLTest() { UserRequestProcessor <User> reqProc = new UserRequestProcessor <User>(); reqProc.BaseUrl = "http://twitter.com/"; Dictionary <string, string> parameters = new Dictionary <string, string> { { "Type", ((int)UserType.Friends).ToString() }, { "ID", "15411837" } }; string expected = "http://twitter.com/statuses/friends/15411837.xml"; var actual = reqProc.BuildURL(parameters); Assert.AreEqual(expected, actual); }
public void NullParametersTest() { UserRequestProcessor <User> target = new UserRequestProcessor <User>() { BaseUrl = "http://twitter.com/" }; Dictionary <string, string> parameters = null; string actual; try { actual = target.BuildURL(parameters); Assert.Fail("Expected ArgumentException."); } catch (ArgumentException ae) { Assert.AreEqual <string>("Type", ae.ParamName); } }
public void NullParametersTest() { UserRequestProcessor<User> target = new UserRequestProcessor<User>() { BaseUrl = "http://twitter.com/" }; Dictionary<string, string> parameters = null; string actual; try { actual = target.BuildURL(parameters); Assert.Fail("Expected ArgumentException."); } catch (ArgumentException ae) { Assert.AreEqual<string>("Type", ae.ParamName); } }
public void BuildURLTest() { UserRequestProcessor<User> reqProc = new UserRequestProcessor<User>(); reqProc.BaseUrl = "http://twitter.com/"; Dictionary<string, string> parameters = new Dictionary<string, string> { { "Type", ((int)UserType.Friends).ToString() }, { "ID", "15411837" } }; string expected = "http://twitter.com/statuses/friends/15411837.xml"; var actual = reqProc.BuildURL(parameters); Assert.AreEqual(expected, actual); }