Exemplo n.º 1
0
        public void WhenConstructedThenInitialized()
        {
            // Arrange

            // Act
            var actual = new EnumVisibilityConverter();

            // Assert
            Assert.IsNotNull(actual);
            Assert.AreEqual(Visibility.Visible, actual.VisibilityWhenEqual);
            Assert.AreEqual(Visibility.Hidden, actual.VisibilityWhenNotEqual);
        }
Exemplo n.º 2
0
        public void WhenConvertBackCalledThenExceptionThrown()
        {
            // Arrange
            var value = Visibility.Visible;
            var converterParameter = DummyEnum.Value1;

            var target = new EnumVisibilityConverter();

            // Act
            var actual = target.ConvertBack(value, typeof(DummyEnum), converterParameter, CultureInfo.InvariantCulture);

            // Assert
        }
Exemplo n.º 3
0
        public void WhenConvertCalledWithMatchingValueThenVisibilityWhenEqualReturned()
        {
            // Arrange
            var expected = Visibility.Collapsed;

            var value = DummyEnum.Value2;
            var converterParameter = DummyEnum.Value2;

            var target = new EnumVisibilityConverter();
            target.VisibilityWhenEqual = Visibility.Collapsed;

            // Act
            var actual = target.Convert(value, typeof(Visibility), converterParameter, CultureInfo.InvariantCulture);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public void WhenWhenFalseSetThenValueUpdated()
        {
            // Arrange
            var expected = Visibility.Collapsed;

            var target = new EnumVisibilityConverter();

            // Act
            target.VisibilityWhenNotEqual = expected;
            var actual = target.VisibilityWhenNotEqual;

            // Assert
            Assert.AreEqual(expected, actual);
        }