public void CanChangeFormat_OfDateTimes_WhenConverting_ObjectsToTable() { var objects = AListOfAnyClass(); var table = new QueryTable<AnyClass>(); table.OnlyShowColumns("A Date Time Property"); table.UseDateTimeFormat("dd-MMM-yyyy"); var expected = new List<object> { new List<object> { new List<object> {"A Date Time Property", "01-Jan-2012"}, }, new List<object> { new List<object> {"A Date Time Property", "02-Feb-2013"}, }, new List<object> { new List<object> {"A Date Time Property", "03-Mar-2014"}, } }; Assert.AreEqual(expected, table.For(objects)); }
public void CanShow_SpecificColumns_WhenConverting_ObjectsToTable() { var objects = AListOfAnyClass(); var table = new QueryTable<AnyClass>(); table.OnlyShowColumns("Any Other Property,Yet Another Property"); var expected = new List<object> { new List<object> { new List<object> {"Any Other Property", "B1"}, new List<object> {"Yet Another Property", "C1"}, }, new List<object> { new List<object> {"Any Other Property", "B2"}, new List<object> {"Yet Another Property", "C2"}, }, new List<object> { new List<object> {"Any Other Property", "B3"}, new List<object> {"Yet Another Property", null}, } }; Assert.AreEqual(expected, table.For(objects)); }