public void ProvideValue_returns_instance() { var converter = new StringNullOrEmptyToInverseBoolConverter(); var providedValue = converter.ProvideValue(null); Assert.IsType <StringNullOrEmptyToInverseBoolConverter>(providedValue); }
public void ConvertBack_throws_NotSupportedException() { var converter = new StringNullOrEmptyToInverseBoolConverter(); var culture = new CultureInfo("en-US"); Assert.Throws <NotSupportedException>(() => converter.ConvertBack(true, typeof(string), null, culture)); }
public void Convert_returns_DependencyPropertyUnsetValue_when_value_is_not_string() { var converter = new StringNullOrEmptyToInverseBoolConverter(); var culture = new CultureInfo("en-US"); var output = converter.Convert(true, typeof(bool), null, culture); Assert.Equal(DependencyProperty.UnsetValue, output); }
public void Convert(object input, Type targetType, object parameter, string cultureString, object expectedOutput) { var converter = new StringNullOrEmptyToInverseBoolConverter(); var culture = new CultureInfo(cultureString); var output = converter.Convert(input, targetType, parameter, culture); Assert.Equal(expectedOutput, output); }