예제 #1
0
        public void Convet_Can_Set_Bottom_To_Zero()
        {
            var conv = new ThicknessZeroSideConverter();

            var result = conv.Convert(new Thickness(20, 15, 10, 5), typeof(Thickness), "bottom", CultureInfo.CurrentCulture);

            Assert.AreEqual(new Thickness(20, 15, 10, 0), result);
        }
예제 #2
0
        public void Thickness_Converts_To_Same_Thickness()
        {
            var conv = new ThicknessZeroSideConverter();

            var result = conv.Convert(new Thickness(20, 15, 10, 5), typeof(Thickness), null, CultureInfo.CurrentCulture);

            Assert.AreEqual(new Thickness(20, 15, 10, 5), result);
        }
예제 #3
0
        public void Single_Number_Converts_To_Regular_Thickness()
        {
            var conv = new ThicknessZeroSideConverter();

            var result = conv.Convert(10, typeof(Thickness), null, CultureInfo.CurrentCulture);

            Assert.AreEqual(new Thickness(10), result);
        }
예제 #4
0
        public void Null_Converts_To_Empty_Thickness()
        {
            var conv = new ThicknessZeroSideConverter();

            var result = conv.Convert(null, typeof(Thickness), null, CultureInfo.CurrentCulture);

            Assert.AreEqual(new Thickness(), result);
        }
예제 #5
0
        public void ConvertBack_Converts_To_Unset()
        {
            var conv = new ThicknessZeroSideConverter();

            var result = conv.ConvertBack(new Thickness(), typeof(Thickness), null, CultureInfo.CurrentCulture);

            Assert.AreEqual(DependencyProperty.UnsetValue, result, "No longer an unsupported operation?");
        }
예제 #6
0
        public void Convet_Can_Set_All_To_Zero_With_Space()
        {
            var conv = new ThicknessZeroSideConverter();

            var result = conv.Convert(new Thickness(20, 15, 10, 5), typeof(Thickness), "right bottom left top", CultureInfo.CurrentCulture);

            Assert.AreEqual(new Thickness(), result);
        }