public void StructuredDynamicYielder() { var result = new StructuredDynamicYielder(new[] { new { A = Col.DateTime2(testDateTime, 5), B = Col.DateTime2(null, 5) } }).First(); Assert.AreEqual(2, result.FieldCount); Assert.AreEqual(typeof(DateTime), result.GetValue(0).GetType()); Assert.AreEqual(testDateTime, result.GetValue(0)); Assert.AreEqual(DBNull.Value, result.GetValue(1)); }
public void Structured() { var rows = DB.GetRows("SELECT * FROM @Input", new { Input = Col.Structured("ListOfDateTime2s", new[] { new { A = Col.DateTime2(testDateTime, 5) }, new { A = Col.DateTime2(null, 5) } }) }); Assert.AreEqual(2, rows.Count); Assert.AreEqual(typeof(DateTime), rows[0].A.GetType()); Assert.AreEqual(testDateTime, rows[0].A); Assert.AreEqual(null, rows[1].A); }
public void Factory() { Assert.IsInstanceOf <SqlDateTime2>(Col.DateTime2(testDateTime, 4)); Assert.IsInstanceOf <SqlDateTime2>(Col.DateTime2(testDateTime)); }