Ejemplo n.º 1
0
        public void WhenConvertingZeroThenResultIsCollapsed()
        {
            var countToVisibilityConverter = new CountToVisibilityConverter();

            object result = countToVisibilityConverter.Convert(0, typeof(int), null, new CultureInfo("en-us"));

            Assert.IsInstanceOfType(result, typeof(Visibility));
            Assert.AreEqual(Visibility.Collapsed, result);
        }
Ejemplo n.º 2
0
        public void WhenConvertingZeroWithVisibilityParametersThenResultIsAsDefinedInParameters()
        {
            var countToVisibilityConverter = new CountToVisibilityConverter();

            object result = countToVisibilityConverter.Convert(0, typeof(int), $"{Visibility.Visible}, {Visibility.Hidden}", new CultureInfo("en-us"));

            Assert.IsInstanceOfType(result, typeof(Visibility));
            Assert.AreEqual(Visibility.Hidden, result);
        }
Ejemplo n.º 3
0
        public void WhenConvertingPositiveNumberThenResultIsVisible()
        {
            var countToVisibilityConverter = new CountToVisibilityConverter();

            object result = countToVisibilityConverter.Convert(2, typeof(int), null, new CultureInfo("en-us"));

            Assert.IsInstanceOfType(result, typeof(Visibility));
            Assert.AreEqual(Visibility.Visible, result);
        }