Ejemplo n.º 1
0
        /// <summary>
        ///     Returns a DATETIME2 parameter value.
        /// </summary>
        /// <param name="value">The parameter value.</param>
        /// <param name="precision">The parameter precision.</param>
        /// <returns>A <see cref="IDbParameterValue" />.</returns>
        public static IDbParameterValue DateTime2(DateTime?value, TSqlDateTime2Precision precision)
        {
            if (!value.HasValue)
            {
                return(new TSqlDateTime2NullValue(precision));
            }

            return(new TSqlDateTime2Value(value.Value, precision));
        }
Ejemplo n.º 2
0
 private static TSqlDateTime2Value SutFactory(DateTime value, TSqlDateTime2Precision precision)
 {
     return new TSqlDateTime2Value(value, precision);
 }
Ejemplo n.º 3
0
        public void CanBeImplicitlyConvertedFromByte()
        {
            TSqlDateTime2Precision sut = 3;

            Assert.That(sut, Is.EqualTo(SutFactory(3)));
        }
 private static TSqlDateTime2Value SutFactory(DateTime value, TSqlDateTime2Precision precision)
 {
     return(new TSqlDateTime2Value(value, precision));
 }
Ejemplo n.º 5
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="TSqlDateTime2NullValue" /> class.
 /// </summary>
 /// <param name="precision">The parameter precision.</param>
 public TSqlDateTime2NullValue(TSqlDateTime2Precision precision)
 {
     _precision = precision;
 }
Ejemplo n.º 6
0
 public void SetUp()
 {
     _precision = new TSqlDateTime2Precision(4);
     _sut       = new TSqlDateTime2NullValue(_precision);
 }
Ejemplo n.º 7
0
        /// <summary>
        ///     Returns a DATETIME2 parameter value.
        /// </summary>
        /// <param name="value">The parameter value.</param>
        /// <param name="precision">The parameter precision.</param>
        /// <returns>A <see cref="IDbParameterValue" />.</returns>
        public static IDbParameterValue DateTime2(DateTime? value, TSqlDateTime2Precision precision)
        {
            if (!value.HasValue)
            {
                return new TSqlDateTime2NullValue(precision);
            }

            return new TSqlDateTime2Value(value.Value, precision);
        }
Ejemplo n.º 8
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="TSqlDateTime2Value" /> class.
 /// </summary>
 /// <param name="value">The parameter value.</param>
 /// <param name="precision">The parameter precision.</param>
 public TSqlDateTime2Value(DateTime value, TSqlDateTime2Precision precision)
 {
     _value = value;
     _precision = precision;
 }