コード例 #1
0
        public void Convert_IfTargetTypeIsNotVisibility_ReturnsUnsetValue()
        {
            // Arrange

            var target = new VisibilityHiddenValueConverter();

            // Act

            var converted = target.Convert(true, typeof(object), null, CultureInfo.InvariantCulture);

            // Assert

            Assert.AreEqual(DependencyProperty.UnsetValue, converted);
        }
コード例 #2
0
        public void Convert_IfParameterTypesAreCorrectAndValueIsNull_ReturnsUnsetValue()
        {
            // Arrange

            var target = new VisibilityHiddenValueConverter();

            // Act

            var converted = target.Convert(null, typeof(Visibility), null, CultureInfo.InvariantCulture);

            // Assert

            Assert.AreEqual(DependencyProperty.UnsetValue, converted);
        }
コード例 #3
0
        public void Convert_IfValueIsNotNullableBoolean_ReturnsUnsetValue()
        {
            // Arrange

            var target = new VisibilityHiddenValueConverter();

            // Act

            var converted = target.Convert(5, typeof(Visibility), null, CultureInfo.InvariantCulture);

            // Assert

            Assert.AreEqual(DependencyProperty.UnsetValue, converted);
        }
コード例 #4
0
        public void Convert_IfParameterTypesAreCorrectAndValueIsFalse_ReturnsHiddenValue()
        {
            // Arrange

            var target = new VisibilityHiddenValueConverter();

            // Act

            var converted = target.Convert(false, typeof(Visibility), null, CultureInfo.InvariantCulture);

            // Assert

            Assert.AreEqual(Visibility.Hidden, converted);
        }