public void convert_back_returns_unset_value_if_value_is_not_a_string() { var converter = new CaseConverter(); Assert.Same(DependencyProperty.UnsetValue, converter.ConvertBack(123, null, null, null)); Assert.Same(DependencyProperty.UnsetValue, converter.ConvertBack(123d, null, null, null)); Assert.Same(DependencyProperty.UnsetValue, converter.ConvertBack(DateTime.Now, null, null, null)); }
public void convert_back_returns_upper_cased_value_if_source_casing_is_upper() { var converter = new CaseConverter { SourceCasing = CharacterCasing.Upper }; Assert.Equal("ABCD", converter.ConvertBack("abcd", null, null, null)); Assert.Equal("ABCD", converter.ConvertBack("ABCD", null, null, null)); Assert.Equal("ABCD", converter.ConvertBack("AbCd", null, null, null)); }
public void convert_back_uses_specified_culture_when_converting_to_upper_case() { var converter = new CaseConverter { SourceCasing = CharacterCasing.Upper }; var cultureInfo = new CultureInfo("tr"); Assert.Equal("İJK", converter.ConvertBack("ijk", null, null, cultureInfo)); Assert.Equal("IJK", converter.ConvertBack("IJK", null, null, cultureInfo)); Assert.Equal("İJK", converter.ConvertBack("iJk", null, null, cultureInfo)); }