예제 #1
0
        public void Converter_ChangeTypeWithType_With_TypeValues()
        {
            var typedDateTime = DateTimeValue.ChangeTypeWithType(typeof(DateTime), CultureInfo.InvariantCulture);

            Assert.AreEqual(DateTimeValue, typedDateTime);

            var typedDecimal = DecimalValue.ChangeTypeWithType(typeof(Decimal), CultureInfo.InvariantCulture);

            Assert.AreEqual(DecimalValue, typedDecimal);

            var typedString = StringValue.ChangeTypeWithType(typeof(String), CultureInfo.InvariantCulture);

            Assert.AreEqual(StringValue, typedString);

            var typedGuid = GuidValue.ChangeTypeWithType(typeof(Guid), CultureInfo.InvariantCulture);

            Assert.AreEqual(GuidValue, typedGuid);

            var typedInt16 = Int16Value.ChangeTypeWithType(typeof(Int16), CultureInfo.InvariantCulture);

            Assert.AreEqual(Int16Value, typedInt16);

            var typedInt32 = Int32Value.ChangeTypeWithType(typeof(Int32), CultureInfo.InvariantCulture);

            Assert.AreEqual(Int32Value, typedInt32);

            var typedInt64 = Int64Value.ChangeTypeWithType(typeof(Int64), CultureInfo.InvariantCulture);

            Assert.AreEqual(Int64Value, typedInt64);

            var typedBool = BoolValue.ChangeTypeWithType(typeof(bool), CultureInfo.InvariantCulture);

            Assert.AreEqual(BoolValue, typedBool);
        }
예제 #2
0
 public object ChangeTypeWithType_Int16()
 {
     return(Int16Value.ChangeTypeWithType(typeof(Int16), CultureInfo.InvariantCulture));
 }