Ejemplo n.º 1
0
        public void ToDbType_WithNullableDateTimeOffset()
        {
            var actual = DbTypeMapper.ToDbType(typeof(DateTimeOffset?));

            //Assert
            actual.Should().Be(DbType.DateTimeOffset);
        }
Ejemplo n.º 2
0
        public void ToDbType_WithNullableDecimal()
        {
            var actual = DbTypeMapper.ToDbType(typeof(decimal?));

            //Assert
            actual.Should().Be(DbType.Decimal);
        }
Ejemplo n.º 3
0
        public void ToDbType_WithNullableByte()
        {
            var actual = DbTypeMapper.ToDbType(typeof(byte?));

            //Assert
            actual.Should().Be(DbType.Byte);
        }
Ejemplo n.º 4
0
        public void ToDbType_WithNullableChar()
        {
            var actual = DbTypeMapper.ToDbType(typeof(char?));

            //Assert
            actual.Should().Be(DbType.String);
        }
Ejemplo n.º 5
0
        public void ToDbType_WithMoney()
        {
            var actual = DbTypeMapper.ToDbType(typeof(Money));

            //Assert
            actual.Should().Be(DbType.Currency);
        }
Ejemplo n.º 6
0
        public void ToDbType_WithNullableBoolean()
        {
            var actual = DbTypeMapper.ToDbType(typeof(bool?));

            //Assert
            actual.Should().Be(DbType.Boolean);
        }
Ejemplo n.º 7
0
        public void ToDbType_WithDateTime()
        {
            var actual = DbTypeMapper.ToDbType(typeof(DateTime));

            //Assert
            actual.Should().Be(DbType.DateTime);
        }
Ejemplo n.º 8
0
        public void ToDbType_WithCharArray()
        {
            var actual = DbTypeMapper.ToDbType(typeof(char[]));

            //Assert
            actual.Should().Be(DbType.String);
        }
Ejemplo n.º 9
0
        public void ToDbType_WithByteArray()
        {
            var actual = DbTypeMapper.ToDbType(typeof(byte[]));

            //Assert
            actual.Should().Be(DbType.Binary);
        }
Ejemplo n.º 10
0
        public void ToDbType_WithNullableDouble()
        {
            var actual = DbTypeMapper.ToDbType(typeof(double?));

            //Assert
            actual.Should().Be(DbType.Double);
        }
Ejemplo n.º 11
0
        public void ToDbType_WithNullableGuid()
        {
            var actual = DbTypeMapper.ToDbType(typeof(Guid?));

            //Assert
            actual.Should().Be(DbType.Guid);
        }
Ejemplo n.º 12
0
        public void ToDbType_WithUnknownType()
        {
            var actual = DbTypeMapper.ToDbType(typeof(DbTypeMapperTests));

            //Assert
            actual.Should().Be(DbType.Object);
        }
Ejemplo n.º 13
0
        public void ToDbType_WithUInt64()
        {
            var actual = DbTypeMapper.ToDbType(typeof(ulong));

            //Assert
            actual.Should().Be(DbType.UInt64);
        }
Ejemplo n.º 14
0
        public void ToDbType_WithXElement()
        {
            var actual = DbTypeMapper.ToDbType(typeof(XElement));

            //Assert
            actual.Should().Be(DbType.Xml);
        }
Ejemplo n.º 15
0
        public void ToDbType_WithUInt16()
        {
            var actual = DbTypeMapper.ToDbType(typeof(ushort));

            //Assert
            actual.Should().Be(DbType.UInt16);
        }
Ejemplo n.º 16
0
        public void ToDbType_WithUInt32()
        {
            var actual = DbTypeMapper.ToDbType(typeof(uint));

            //Assert
            actual.Should().Be(DbType.UInt32);
        }
Ejemplo n.º 17
0
        public void ToDbType_WithString()
        {
            var actual = DbTypeMapper.ToDbType(typeof(string));

            //Assert
            actual.Should().Be(DbType.String);
        }
Ejemplo n.º 18
0
        public void ToDbType_WithTimeSpan()
        {
            var actual = DbTypeMapper.ToDbType(typeof(TimeSpan));

            //Assert
            actual.Should().Be(DbType.Time);
        }
Ejemplo n.º 19
0
        public void ToDbType_WithSingle()
        {
            var actual = DbTypeMapper.ToDbType(typeof(float));

            //Assert
            actual.Should().Be(DbType.Single);
        }
Ejemplo n.º 20
0
        public void ToDbType_WithSByte()
        {
            var actual = DbTypeMapper.ToDbType(typeof(sbyte));

            //Assert
            actual.Should().Be(DbType.SByte);
        }
Ejemplo n.º 21
0
        public void ToDbType_WithNullableInt64()
        {
            var actual = DbTypeMapper.ToDbType(typeof(long?));

            //Assert
            actual.Should().Be(DbType.Int64);
        }
Ejemplo n.º 22
0
        public void ToDbType_WithNullableInt16()
        {
            var actual = DbTypeMapper.ToDbType(typeof(short?));

            //Assert
            actual.Should().Be(DbType.Int16);
        }
 /// <summary>Initializes an instance of the <see cref="DataParameter"/> class.</summary>
 /// <param name="name">The name of the parameter.</param>
 /// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/>.</exception>
 /// <exception cref="ArgumentException"><paramref name="name"/> is empty.</exception>
 public DataParameter(string name) : base(name, DbTypeMapper.ToDbType(typeof(T)), ParameterDirection.Input)
 {
 }
 /// <summary>Initializes an instance of the <see cref="DataParameter"/> class.</summary>
 /// <param name="name">The name of the parameter.</param>
 /// <param name="direction">The direction of the parameter.</param>
 /// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/>.</exception>
 /// <exception cref="ArgumentException"><paramref name="name"/> is empty.</exception>
 public DataParameter(string name, ParameterDirection direction) : base(name, DbTypeMapper.ToDbType(typeof(T)), direction)
 {
 }