public void ConvertTo_NotSupported(Type type) { var conv = new ColorConverter(); var col = Color.Red; Assert.Throws<NotSupportedException>(() => { conv.ConvertTo(null, CultureInfo.InvariantCulture, col, type); }); }
public void ConvertTo_Named(string name) { var conv = new ColorConverter(); Assert.Equal(name, (string) conv.ConvertTo(null, CultureInfo.InvariantCulture, Color.FromName(name), typeof(string))); }
public void ConvertTo_Empty() { var conv = new ColorConverter(); Assert.Equal(string.Empty, (string) conv.ConvertTo(null, CultureInfo.InvariantCulture, Color.Empty, typeof(string))); }
public void ConvertTo(int a, int r, int g, int b) { var conv = new ColorConverter(); Assert.Equal($"{a}, {r}, {g}, {b}", (string) conv.ConvertTo(null, CultureInfo.InvariantCulture, Color.FromArgb(a, r, g, b), typeof(string))); }