public void Invalid_value_and_target_type() { var converter = new WindowWidthForShadowConverter(); Assert.ThrowsException <InvalidOperationException>(() => converter.Convert(new object[] { "Hello", 15 }, typeof(double), null, null)); }
public void Change_appropriate_radius_for_titlebar_from_irregular_input() { var converter = new WindowWidthForShadowConverter(); var res = converter.Convert(new object[] { (double)100.0, new Thickness(5, 2, 3, 1) }, typeof(double), null, null); Assert.AreEqual(typeof(double), res.GetType()); Assert.AreEqual(108, (double)res); }
public void Invalid_first_value() { var converter = new WindowWidthForShadowConverter(); Assert.ThrowsException <InvalidOperationException>(() => converter.Convert(new object[] { true, new Thickness(5) }, typeof(double), null, null)); Assert.ThrowsException <InvalidOperationException>(() => converter.Convert(new object[] { "Hello", new Thickness(5) }, typeof(double), null, null)); }
public void Invalid_target_type() { var converter = new WindowWidthForShadowConverter(); Assert.ThrowsException <InvalidOperationException>(() => converter.Convert(new object[] { (double)100.0, new Thickness(5) }, typeof(string), null, null)); Assert.ThrowsException <InvalidOperationException>(() => converter.Convert(new object[] { (double)100.0, new Thickness(5) }, typeof(bool), null, null)); }