Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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);
        }