1 write to _icoConvFrmTD
System.Drawing.Common.Tests (1)
System\Drawing\IconConverterTests.cs (1)
31
_icoConvFrmTD
= (IconConverter)TypeDescriptor.GetConverter(_icon);
49 references to _icoConvFrmTD
System.Drawing.Common.Tests (49)
System\Drawing\IconConverterTests.cs (49)
50
Assert.True(
_icoConvFrmTD
.CanConvertFrom(typeof(byte[])), "TD byte[] (no context)");
51
Assert.True(
_icoConvFrmTD
.CanConvertFrom(null, typeof(byte[])), "TD byte[]");
52
Assert.True(
_icoConvFrmTD
.CanConvertFrom(null, _iconBytes.GetType()), "TD _iconBytes.GetType()");
53
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(string)), "TD string");
54
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(Rectangle)), "TD Rectangle");
55
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(Point)), "TD Point");
56
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(PointF)), "TD PointF");
57
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(Size)), "TD Size");
58
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(SizeF)), "TD SizeF");
59
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(object)), "TD object");
60
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(int)), "TD int");
61
Assert.False(
_icoConvFrmTD
.CanConvertFrom(null, typeof(Metafile)), "TD Metafile");
85
Assert.True(
_icoConvFrmTD
.CanConvertTo(typeof(string)), "TD string (no context)");
86
Assert.True(
_icoConvFrmTD
.CanConvertTo(null, typeof(string)), "TD string");
87
Assert.True(
_icoConvFrmTD
.CanConvertTo(null, _iconStr.GetType()), "TD _iconStr.GetType()");
88
Assert.True(
_icoConvFrmTD
.CanConvertTo(typeof(byte[])), "TD byte[] (no context)");
89
Assert.True(
_icoConvFrmTD
.CanConvertTo(null, typeof(byte[])), "TD byte[]");
90
Assert.True(
_icoConvFrmTD
.CanConvertTo(null, _iconBytes.GetType()), "TD _iconBytes.GetType()");
91
Assert.True(
_icoConvFrmTD
.CanConvertTo(typeof(Image)), "TD Image (no context)");
92
Assert.True(
_icoConvFrmTD
.CanConvertTo(null, typeof(Image)), "TD Image");
93
Assert.True(
_icoConvFrmTD
.CanConvertTo(typeof(Bitmap)), "TD Bitmap (no context)");
94
Assert.True(
_icoConvFrmTD
.CanConvertTo(null, typeof(Bitmap)), "TD Bitmap");
95
Assert.False(
_icoConvFrmTD
.CanConvertTo(null, typeof(Rectangle)), "TD Rectangle");
96
Assert.False(
_icoConvFrmTD
.CanConvertTo(null, typeof(Point)), "TD Point");
97
Assert.False(
_icoConvFrmTD
.CanConvertTo(null, typeof(PointF)), "TD PointF");
98
Assert.False(
_icoConvFrmTD
.CanConvertTo(null, typeof(Size)), "TD Size");
99
Assert.False(
_icoConvFrmTD
.CanConvertTo(null, typeof(SizeF)), "TD SizeF");
100
Assert.False(
_icoConvFrmTD
.CanConvertTo(null, typeof(object)), "TD object");
101
Assert.False(
_icoConvFrmTD
.CanConvertTo(null, typeof(int)), "TD int");
119
newIcon = (Icon)
_icoConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, _iconBytes);
124
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertFrom("System.Drawing.String"));
125
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
126
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, new Bitmap(20, 20)));
127
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, new Point(10, 10)));
128
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
129
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
152
Assert.Equal(_iconStr, (string)
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(string)));
153
Assert.Equal(_iconStr, (string)
_icoConvFrmTD
.ConvertTo(_icon, typeof(string)));
155
newIconBytes = (byte[])
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _iconBytes.GetType());
158
newIconBytes = (byte[])
_icoConvFrmTD
.ConvertTo(_icon, _iconBytes.GetType());
161
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Rectangle)));
162
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _icon.GetType()));
163
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Size)));
164
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Point)));
165
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Metafile)));
166
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(object)));
167
Assert.Throws<NotSupportedException>(() =>
_icoConvFrmTD
.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(int)));
174
Assert.Equal("(none)", (string)
_icoConvFrmTD
.ConvertTo(null, typeof(string)));
175
Assert.Equal("(none)", (string)
_icoConvFrmTD
.ConvertTo(null, CultureInfo.CreateSpecificCulture("de-DE"), null, typeof(string)));