Beispiel #1
0
        public void ConvertsToBooleanString()
        {
            var forTrue  = _propertyConverter.ConvertBack(true);
            var forFalse = _propertyConverter.ConvertBack(false);

            Assert.AreEqual(forTrue, "True");
            Assert.AreEqual(forFalse, "False");
        }
        public void ConvertsToObjectString()
        {
            var obj       = "object";
            var forObject = _propertyConverter.ConvertBack(obj);

            Assert.AreEqual(forObject, (string)obj);
        }
        public void ConvertsToDateTimeString()
        {
            var now        = DateTime.Now;
            var dateString = now.ToString();

            var forDateTime = _propertyConverter.ConvertBack(now);

            Assert.AreEqual(dateString, forDateTime);
        }
Beispiel #4
0
        internal object GetConvertBackValue(object value)
        {
            object             result;
            IPropertyConverter propertyConverter = this.PropertyConverter;

            if (propertyConverter != null)
            {
                result = propertyConverter.ConvertBack(value);
            }
            else
            {
                result = value;
            }

            return(result);
        }
        public void ConvertsToDoubleString()
        {
            var forDouble = _propertyConverter.ConvertBack(1.25);

            Assert.AreEqual(forDouble, "1.25");
        }
Beispiel #6
0
        public void ConvertsToIntegerString()
        {
            var forInteger = _propertyConverter.ConvertBack(115);

            Assert.AreEqual(forInteger, "115");
        }