Пример #1
0
        public void ShouldConvertBackWithDefaultOffsetForWrongParameter()
        {
            object converted = new ExpanderHeaderWidthConverter().ConvertBack(100.0, null, "wrong", null);

            Assert.IsInstanceOfType(converted, typeof(double));
            Assert.AreEqual <double>(100 - ExpanderHeaderWidthConverter.DefaultOffset, (double)converted);
        }
Пример #2
0
        public void ShouldReturnValueWithDefaultOffset()
        {
            object converted = new ExpanderHeaderWidthConverter().Convert(100.0, null, null, null);

            Assert.IsInstanceOfType(converted, typeof(double));
            Assert.AreEqual <double>(100 + ExpanderHeaderWidthConverter.DefaultOffset, (double)converted);
        }
Пример #3
0
        public void ShouldConvertBackWithCustomOffset()
        {
            object converted = new ExpanderHeaderWidthConverter().ConvertBack(100.0, null, 50, null);

            Assert.IsInstanceOfType(converted, typeof(double));
            Assert.AreEqual <double>(50, (double)converted);
        }