public void Lower_Parameter_Converts_To_Lower_Case() { var conv = new TextCaseConverter(); var result = conv.Convert("LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. VIVAMUS UT PORTA LECTUS, NEC TINCIDUNT MAURIS.", typeof(string), "lower", CultureInfo.CurrentCulture); Assert.AreEqual("lorem ipsum dolor sit amet, consectetur adipiscing elit. vivamus ut porta lectus, nec tincidunt mauris.", result); }
public void TextCaseConverter(object value, object comparedValue, object expectedResult) { var textCaseConverter = new TextCaseConverter(); var result = textCaseConverter.Convert(value, typeof(TextCaseConverter_Tests), comparedValue, CultureInfo.CurrentCulture); Assert.Equal(result, expectedResult); }
public void Null_Converts_To_Null() { var conv = new TextCaseConverter(); var result = conv.Convert(null, typeof(string), null, CultureInfo.CurrentCulture); Assert.IsNull(result); }
public void ConvertBack_Converts_To_Unset() { var conv = new TextCaseConverter(); var result = conv.ConvertBack(true, typeof(double), null, CultureInfo.CurrentCulture); Assert.AreEqual(DependencyProperty.UnsetValue, result, "No longer an unsupported operation?"); }
public void TextCaseConverterWithParameter(object?value, object?comparedValue, object?expectedResult) { var textCaseConverter = new TextCaseConverter(); var result = textCaseConverter.Convert(value, typeof(string), comparedValue, CultureInfo.CurrentCulture); Assert.AreEqual(result, expectedResult); }
public void Title_Parameter_Converts_To_Title_Case() { var conv = new TextCaseConverter(); var input = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ut porta lectus, nec tincidunt mauris."; var result = conv.Convert(input, typeof(string), "title", CultureInfo.CurrentCulture); Assert.AreEqual("Lorem Ipsum Dolor Sit Amet, Consectetur Adipiscing Elit. Vivamus Ut Porta Lectus, Nec Tincidunt Mauris.", result); }
public void TextCaseConverterWithExplicitType(object?value, TextCaseType textCaseType, object?expectedResult) { var textCaseConverter = new TextCaseConverter { Type = textCaseType }; var result = textCaseConverter.Convert(value, typeof(string), null, CultureInfo.CurrentCulture); Assert.AreEqual(result, expectedResult); }
public void InValidConverterValuesThrowArgumenException(object value) { var textCaseConverter = new TextCaseConverter(); Assert.Throws <ArgumentException>(() => textCaseConverter.Convert(value, typeof(TextCaseConverter_Tests), null, CultureInfo.CurrentCulture)); }