public void DateTimeGetsConvertedToUnixTs() { var target = new Api(); DateTime date = new DateTime(2015, 4, 4, 16, 32, 17, 3, DateTimeKind.Utc); var result = target.FormatUrlInvoke("a{DateTime date}z", "DateTime date", date); Assert.AreEqual("a1428165137003z", result); }
public void FormatUrl1WithFieldsAndPlaceholder() { var target = new Api(); var result = target.FormatUrlInvoke("a{b}a{FieldSelector}a", new FieldSelector<object>().Add("hello").Add("world"), "b", "c"); Assert.AreEqual("aca:(hello,world)a", result); }
public void FormatUrl1() { var target = new Api(); var result = target.FormatUrlInvoke("a{b}a", "b", "c"); Assert.AreEqual("aca", result); }
public void FormatUrl0WithFieldsButNoPlaceholder() { var target = new Api(); var result = target.FormatUrlInvoke("a", new FieldSelector<object>().Add("hello").Add("world")); Assert.AreEqual("a", result); }
public void FormatUrl0() { var target = new Api(); var result = target.FormatUrlInvoke("a"); Assert.AreEqual("a", result); }
public void DefaultValueAndType() { var target = new Api(); var result = target.FormatUrlInvoke("a{bool b = false}z", "bool b = false", true.ToString()); Assert.AreEqual("aTruez", result); }
public void FormatUrlWithSlashFieldSelector() { var target = new Api(); var result = target.FormatUrlInvoke("a{FieldSelector}a", FieldSelector.For<object>().Add("site-standard-profile-request/url")); Assert.AreEqual("a:(site-standard-profile-request/url)a", result); }