Example #1
0
        public void ConvertValueForDecimalMarkWithCommaFails()
        {
            TestDelegate testDelegate = () => TypeConversionUtils.ConvertValueIfNecessary(typeof(Double), "1,2", "foo");

            Assert.Throws <TypeMismatchException>(testDelegate);
        }
Example #2
0
        public void ConvertValueWithDutchCultureForDecimalMarkWithCommaReturnsValue()
        {
            object o = TypeConversionUtils.ConvertValueIfNecessary(typeof(Double), "1,2", "foo");

            Assert.That(o, Is.EqualTo(1.2));
        }
Example #3
0
        public void NullAbleTest()
        {
            object o = TypeConversionUtils.ConvertValueIfNecessary(typeof(DateTime?), "", "bla");

            Assert.IsNull(o);
        }