public void TestConvertWithWrongValue() { var converter = new ListToStringConverter(); Action action = () => converter.Convert(new [] { 1, 2, 3 }, null, null, null); action.Should().Throw <InvalidOperationException>(); }
public void ListToStringConverter(object value, object parameter, object expectedResult) { var listToStringConverter = new ListToStringConverter(); var result = listToStringConverter.Convert(value, null, parameter, null); Assert.AreEqual(result, expectedResult); }
public void TestConvert() { var converter = new ListToStringConverter(); var result = converter.Convert(new [] { "one", "two", "three" }, null, null, null); result.Should().Be($"one{Environment.NewLine}two{Environment.NewLine}three"); }
public void InValidConverterParametersThrowArgumentException(object parameter) { var listToStringConverter = new ListToStringConverter(); Assert.Throws <ArgumentException>(() => listToStringConverter.Convert(new object[0], null, parameter, null)); }
public void InValidConverterValuesThrowArgumentException(object value) { var listToStringConverter = new ListToStringConverter(); Assert.Throws <ArgumentException>(() => listToStringConverter.Convert(value, null, null, null)); }