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