예제 #1
0
        public void GetParameter()
        {
            SqlType col = new SqlStructured("MyType", null);
            var param = col.GetParameter();
            TestHelper.AssertSqlParameter(param, SqlDbType.Structured, DBNull.Value);

            col = new SqlStructured("MyType", value);
            param = col.GetParameter();
            Assert.AreEqual(SqlDbType.Structured, param.SqlDbType);
            Assert.AreEqual("MyType", param.TypeName);
            Assert.AreEqual(typeof(StructuredDynamicYielder), param.Value.GetType());
            Assert.AreEqual(2, ((IEnumerable<SqlDataRecord>)param.Value).Count());
        }
예제 #2
0
        public void GetRawValue()
        {
            SqlType col = new SqlStructured("A", null);

            Assert.Throws<InvalidOperationException>(() => col.GetRawValue());
        }