Convert() public method

public Convert ( object value, Type targetType, object parameter, System culture ) : object
value object
targetType System.Type
parameter object
culture System
return object
コード例 #1
0
        public void Convert_NotBool()
        {
            // Arrange
            var converter = new BoolToVisibilityConverter();

            // Act
            var result = (Visibility)converter.Convert(new object(), null, null, null);

            // Assert
            Assert.AreEqual(Visibility.Collapsed, result);
        }
コード例 #2
0
        public void Convert_True()
        {
            // Arrange
            var converter = new BoolToVisibilityConverter();

            // Act
            var result = (Visibility)converter.Convert(true, null, null, null);

            // Assert
            Assert.AreEqual(Visibility.Visible, result);
        }
コード例 #3
0
        public void Convert_False()
        {
            // Arrange
            var converter = new BoolToVisibilityConverter();

            // Act
            var result = (Visibility)converter.Convert(false, null, null, null);

            // Assert
            Assert.AreEqual(Visibility.Collapsed, result);
        }