Beispiel #1
0
        public void ConvertTest()
        {
            DisplayModeToVisibility target = new DisplayModeToVisibility();
            object      value      = true;
            Type        targetType = null;
            object      parameter  = null;
            CultureInfo culture    = null;
            object      expected   = "Visible";
            object      actual;

            actual = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);

            value    = false;
            expected = "Visible";
            actual   = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);

            value    = null;
            expected = "Collapsed";
            actual   = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);

            target.Invert = true;

            expected = "Visible";
            actual   = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);

            value    = false;
            expected = "Collapsed";
            actual   = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);
        }
        public void ConvertTest()
        {
            DisplayModeToVisibility target = new DisplayModeToVisibility();
            object value = true;
            Type targetType = null;
            object parameter = null;
            CultureInfo culture = null;
            object expected = "Visible";
            object actual;
            actual = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);

            value = false;
            expected = "Visible";
            actual = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);

            value = null;
            expected = "Collapsed";
            actual = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);

            target.Invert = true;

            expected = "Visible";
            actual = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);

            value = false;
            expected = "Collapsed";
            actual = target.Convert(value, targetType, parameter, culture);
            Assert.AreEqual(expected, actual);
        }