Пример #1
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = Col.DateTimeOffset(testValue, 4),
                                                                  B = Col.DateTimeOffset(null, 4)
                                                              } }).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(DateTimeOffset), result.GetValue(0).GetType());
            Assert.AreEqual(testValue, result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #2
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = Col.NChar("язк", 10),
                                                                  B = Col.NChar(null, 10)
                                                              } }).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(string), result.GetValue(0).GetType());
            Assert.AreEqual("язк", result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #3
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = Col.Decimal(5.27m, 10, 5),
                                                                  B = Col.Decimal(null, 10, 5)
                                                              } }).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(decimal), result.GetValue(0).GetType());
            Assert.AreEqual(5.27m, result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #4
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = Col.Image(data),
                                                                  B = Col.Image(null)
                                                              } }).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(byte[]), result.GetValue(0).GetType());
            Assert.AreEqual(data, result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #5
0
        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));
        }
Пример #6
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = Col.Real(5.27f),
                                                                  B = Col.Real(null)
                                                              } }).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(float), result.GetValue(0).GetType());
            Assert.AreEqual(5.27f, result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #7
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = Col.Time(testValue, 5),
                                                                  B = Col.Time(null, 5)
                                                              } }).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(TimeSpan), result.GetValue(0).GetType());
            Assert.AreEqual(testValue, result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #8
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = guid,
                                                                  B = (Guid?)guid,
                                                                  C = Col.UniqueIdentifier(guid),
                                                                  D = (Guid?)null,
                                                                  E = Col.UniqueIdentifier(null)
                                                              } }).First();

            Assert.AreEqual(5, result.FieldCount);
            Assert.AreEqual(typeof(Guid), result.GetValue(0).GetType());
            Assert.AreEqual(guid, result.GetValue(0));
            Assert.AreEqual(typeof(Guid), result.GetValue(1).GetType());
            Assert.AreEqual(guid, result.GetValue(1));
            Assert.AreEqual(typeof(Guid), result.GetValue(2).GetType());
            Assert.AreEqual(guid, result.GetValue(2));
            Assert.AreEqual(DBNull.Value, result.GetValue(3));
            Assert.AreEqual(DBNull.Value, result.GetValue(4));
        }
Пример #9
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = true,
                                                                  B = (bool?)false,
                                                                  C = Col.Bit(true),
                                                                  D = (bool?)null,
                                                                  E = Col.Bit(null)
                                                              } }).First();

            Assert.AreEqual(5, result.FieldCount);
            Assert.AreEqual(typeof(bool), result.GetValue(0).GetType());
            Assert.AreEqual(true, result.GetValue(0));
            Assert.AreEqual(typeof(bool), result.GetValue(1).GetType());
            Assert.AreEqual(false, result.GetValue(1));
            Assert.AreEqual(typeof(bool), result.GetValue(2).GetType());
            Assert.AreEqual(true, result.GetValue(2));
            Assert.AreEqual(DBNull.Value, result.GetValue(3));
            Assert.AreEqual(DBNull.Value, result.GetValue(4));
        }
Пример #10
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                                                                  A = 1,
                                                                  B = (int?)2,
                                                                  C = Col.Int(3),
                                                                  D = (int?)null,
                                                                  E = Col.Int(null)
                                                              } }).First();

            Assert.AreEqual(5, result.FieldCount);
            Assert.AreEqual(typeof(int), result.GetValue(0).GetType());
            Assert.AreEqual(1, result.GetValue(0));
            Assert.AreEqual(typeof(int), result.GetValue(1).GetType());
            Assert.AreEqual(2, result.GetValue(1));
            Assert.AreEqual(typeof(int), result.GetValue(2).GetType());
            Assert.AreEqual(3, result.GetValue(2));
            Assert.AreEqual(DBNull.Value, result.GetValue(3));
            Assert.AreEqual(DBNull.Value, result.GetValue(4));
        }
Пример #11
0
        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));
        }
Пример #12
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                A = Col.Text("Test"),
                B = Col.Text(null)
            }}).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));
        }
Пример #13
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                A = (byte)1,
                B = (byte?)2,
                C = Col.TinyInt(3),
                D = (byte?)null,
                E = Col.TinyInt(null)
            }}).First();

            Assert.AreEqual(5, result.FieldCount);
            Assert.AreEqual(typeof(byte), result.GetValue(0).GetType());
            Assert.AreEqual(1, result.GetValue(0));
            Assert.AreEqual(typeof(byte), result.GetValue(1).GetType());
            Assert.AreEqual(2, result.GetValue(1));
            Assert.AreEqual(typeof(byte), result.GetValue(2).GetType());
            Assert.AreEqual(3, result.GetValue(2));
            Assert.AreEqual(DBNull.Value, result.GetValue(3));
            Assert.AreEqual(DBNull.Value, result.GetValue(4));
        }
Пример #14
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                A = Col.SmallMoney(5.27m),
                B = Col.SmallMoney(null)
            }}).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(decimal), result.GetValue(0).GetType());
            Assert.AreEqual(5.27m, result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #15
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                A = true,
                B = (bool?)false,
                C = Col.Bit(true),
                D = (bool?)null,
                E = Col.Bit(null)
            }}).First();

            Assert.AreEqual(5, result.FieldCount);
            Assert.AreEqual(typeof(bool), result.GetValue(0).GetType());
            Assert.AreEqual(true, result.GetValue(0));
            Assert.AreEqual(typeof(bool), result.GetValue(1).GetType());
            Assert.AreEqual(false, result.GetValue(1));
            Assert.AreEqual(typeof(bool), result.GetValue(2).GetType());
            Assert.AreEqual(true, result.GetValue(2));
            Assert.AreEqual(DBNull.Value, result.GetValue(3));
            Assert.AreEqual(DBNull.Value, result.GetValue(4));
        }
Пример #16
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                A = Col.VarBinary(data, 10),
                B = Col.VarBinary(null, 10)
            }}).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(byte[]), result.GetValue(0).GetType());
            Assert.AreEqual(data, result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #17
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                A = Col.Float(5.27d),
                B = Col.Float(null)
            }}).First();

            Assert.AreEqual(2, result.FieldCount);
            Assert.AreEqual(typeof(double), result.GetValue(0).GetType());
            Assert.AreEqual(5.27d, result.GetValue(0));
            Assert.AreEqual(DBNull.Value, result.GetValue(1));
        }
Пример #18
0
        public void StructuredDynamicYielder()
        {
            var result = new StructuredDynamicYielder(new[] { new {
                A = guid,
                B = (Guid?)guid,
                C = Col.UniqueIdentifier(guid),
                D = (Guid?)null,
                E = Col.UniqueIdentifier(null)
            }}).First();

            Assert.AreEqual(5, result.FieldCount);
            Assert.AreEqual(typeof(Guid), result.GetValue(0).GetType());
            Assert.AreEqual(guid, result.GetValue(0));
            Assert.AreEqual(typeof(Guid), result.GetValue(1).GetType());
            Assert.AreEqual(guid, result.GetValue(1));
            Assert.AreEqual(typeof(Guid), result.GetValue(2).GetType());
            Assert.AreEqual(guid, result.GetValue(2));
            Assert.AreEqual(DBNull.Value, result.GetValue(3));
            Assert.AreEqual(DBNull.Value, result.GetValue(4));
        }