public void StructuredDynamicYielder() { var result = new StructuredDynamicYielder(new[] { new { A = Col.Char("Test", 10), B = Col.Char(null, 10) } }).First(); Assert.AreEqual(2, result.FieldCount); Assert.AreEqual(typeof(string), result.GetValue(0).GetType()); Assert.AreEqual("Test", result.GetValue(0)); Assert.AreEqual(DBNull.Value, result.GetValue(1)); }
public void Structured() { var rows = DB.GetRows("SELECT * FROM @Input", new { Input = Col.Structured("ListOfChars", new[] { new { A = Col.Char("Test", 10) }, new { A = Col.Char(null, 10) } }) }); Assert.AreEqual(2, rows.Count); Assert.AreEqual(typeof(string), rows[0].A.GetType()); Assert.AreEqual("Test ", rows[0].A); Assert.AreEqual(null, rows[1].A); }
public void Factory() { Assert.IsInstanceOf <SqlChar>(Col.Char("Test", 10)); Assert.IsInstanceOf <SqlChar>(Col.Char("Test")); }