public void ConvertTest() { const Visibility trueValue = Visibility.Collapsed; const Visibility falseValue = Visibility.Visible; var converter = new BooleanToVisibilityConverter(trueValue, falseValue, Visibility.Visible); converter.Convert(true, typeof(Visibility), null, null).ShouldEqual(trueValue); converter.Convert(false, typeof(Visibility), null, null).ShouldEqual(falseValue); }
public void ConvertShouldThrowExceptionInvalidValue() { var converter = new BooleanToVisibilityConverter(Visibility.Collapsed, Visibility.Visible, Visibility.Visible); Action action = () => converter.Convert(new object(), typeof (object), null, null); action.ShouldThrow(); }