Convert() public method

public Convert ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object
targetType System.Type
parameter object
culture System.Globalization.CultureInfo
return object
        public void BoolToVisibilityConverter_Convert_NonBoolInput_ThrowsArgumentException()
        {
            var converter = new BoolToVisibilityConverter();

            Exceptions.Expect<ArgumentException>(() =>
            {
                converter.Convert("NotABoolean", typeof(Visibility), null, CultureInfo.InvariantCulture);
            });
        }
        public void BoolToVisibilityConverter_Convert_NonVisibilityOutput_ThrowsArgumentException()
        {
            var converter = new BoolToVisibilityConverter();
            var notVisibilityType = typeof(string);

            Exceptions.Expect<ArgumentException>(() =>
            {
                converter.Convert(true, notVisibilityType, null, CultureInfo.InvariantCulture);
            });
        }
        public void BoolToVisibilityConverter_Convert_False_ReturnsFalseValue()
        {
            var converter = new BoolToVisibilityConverter
            {
                TrueValue = Visibility.Hidden,
                FalseValue = Visibility.Visible
            };
            object result = converter.Convert(false, typeof(Visibility), null, CultureInfo.InvariantCulture);

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