1 write to _icoConv
System.Drawing.Common.Tests (1)
System\Drawing\IconConverterTests.cs (1)
30
_icoConv
= new IconConverter();
49 references to _icoConv
System.Drawing.Common.Tests (49)
System\Drawing\IconConverterTests.cs (49)
37
Assert.True(
_icoConv
.CanConvertFrom(typeof(byte[])), "byte[] (no context)");
38
Assert.True(
_icoConv
.CanConvertFrom(null, typeof(byte[])), "byte[]");
39
Assert.True(
_icoConv
.CanConvertFrom(null, _iconBytes.GetType()), "_iconBytes.GetType()");
40
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(string)), "string");
41
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(Rectangle)), "Rectangle");
42
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(Point)), "Point");
43
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(PointF)), "PointF");
44
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(Size)), "Size");
45
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(SizeF)), "SizeF");
46
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(object)), "object");
47
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(int)), "int");
48
Assert.False(
_icoConv
.CanConvertFrom(null, typeof(Metafile)), "Metafile");
67
Assert.True(
_icoConv
.CanConvertTo(typeof(string)), "string (no context)");
68
Assert.True(
_icoConv
.CanConvertTo(null, typeof(string)), "string");
69
Assert.True(
_icoConv
.CanConvertTo(null, _iconStr.GetType()), "_iconStr.GetType()");
70
Assert.True(
_icoConv
.CanConvertTo(typeof(byte[])), "byte[] (no context)");
71
Assert.True(
_icoConv
.CanConvertTo(null, typeof(byte[])), "byte[]");
72
Assert.True(
_icoConv
.CanConvertTo(null, _iconBytes.GetType()), "_iconBytes.GetType()");
73
Assert.True(
_icoConv
.CanConvertTo(typeof(Image)), "Image (no context)");
74
Assert.True(
_icoConv
.CanConvertTo(null, typeof(Image)), "Image");
75
Assert.True(
_icoConv
.CanConvertTo(typeof(Bitmap)), "Bitmap (no context)");
76
Assert.True(
_icoConv
.CanConvertTo(null, typeof(Bitmap)), "Bitmap");
77
Assert.False(
_icoConv
.CanConvertTo(null, typeof(Rectangle)), "Rectangle");
78
Assert.False(
_icoConv
.CanConvertTo(null, typeof(Point)), "Point");
79
Assert.False(
_icoConv
.CanConvertTo(null, typeof(PointF)), "PointF");
80
Assert.False(
_icoConv
.CanConvertTo(null, typeof(Size)), "Size");
81
Assert.False(
_icoConv
.CanConvertTo(null, typeof(SizeF)), "SizeF");
82
Assert.False(
_icoConv
.CanConvertTo(null, typeof(object)), "object");
83
Assert.False(
_icoConv
.CanConvertTo(null, typeof(int)), "int");
107
Icon newIcon = (Icon)
_icoConv
.ConvertFrom(null, CultureInfo.InvariantCulture, _iconBytes);
112
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertFrom("System.Drawing.String"));
113
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
114
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new Bitmap(20, 20)));
115
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new Point(10, 10)));
116
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
117
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
135
Assert.Equal(_iconStr, (string)
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(string)));
136
Assert.Equal(_iconStr, (string)
_icoConv
.ConvertTo(_icon, typeof(string)));
138
byte[] newIconBytes = (byte[])
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _iconBytes.GetType());
141
newIconBytes = (byte[])
_icoConv
.ConvertTo(_icon, _iconBytes.GetType());
144
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Rectangle)));
145
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _icon.GetType()));
146
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Size)));
147
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Point)));
148
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Metafile)));
149
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(object)));
150
Assert.Throws<NotSupportedException>(() =>
_icoConv
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(int)));
171
Assert.Equal("(none)", (string)
_icoConv
.ConvertTo(null, typeof(string)));
172
Assert.Equal("(none)", (string)
_icoConv
.ConvertTo(null, CultureInfo.CreateSpecificCulture("ru-RU"), null, typeof(string)));