1 write to _imgConv
System.Drawing.Common.Tests (1)
System\Drawing\ImageConverterTests.cs (1)
28
_imgConv
= new ImageConverter();
53 references to _imgConv
System.Drawing.Common.Tests (53)
System\Drawing\ImageConverterTests.cs (53)
39
Bitmap IconBitmap = (Bitmap)
_imgConv
.ConvertFrom(icon);
61
Assert.True(
_imgConv
.CanConvertFrom(typeof(byte[])), "byte[] (no context)");
62
Assert.True(
_imgConv
.CanConvertFrom(null, typeof(byte[])), "byte[]");
63
Assert.True(
_imgConv
.CanConvertFrom(null, _imageBytes.GetType()), "_imageBytes.GetType()");
64
Assert.True(
_imgConv
.CanConvertFrom(typeof(Icon)), "Icon (no context)");
65
Assert.True(
_imgConv
.CanConvertFrom(null, typeof(Icon)), "Icon");
66
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(string)), "string");
67
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(Rectangle)), "Rectangle");
68
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(Point)), "Point");
69
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(PointF)), "PointF");
70
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(Size)), "Size");
71
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(SizeF)), "SizeF");
72
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(object)), "object");
73
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(int)), "int");
74
Assert.False(
_imgConv
.CanConvertFrom(null, typeof(Metafile)), "Mefafile");
93
Assert.True(
_imgConv
.CanConvertTo(typeof(string)), "stirng (no context)");
94
Assert.True(
_imgConv
.CanConvertTo(null, typeof(string)), "string");
95
Assert.True(
_imgConv
.CanConvertTo(null, _imageStr.GetType()), "_imageStr.GetType()");
96
Assert.True(
_imgConv
.CanConvertTo(typeof(byte[])), "byte[] (no context)");
97
Assert.True(
_imgConv
.CanConvertTo(null, typeof(byte[])), "byte[]");
98
Assert.True(
_imgConv
.CanConvertTo(null, _imageBytes.GetType()), "_imageBytes.GetType()");
99
Assert.False(
_imgConv
.CanConvertTo(null, typeof(Rectangle)), "Rectangle");
100
Assert.False(
_imgConv
.CanConvertTo(null, typeof(Point)), "Point");
101
Assert.False(
_imgConv
.CanConvertTo(null, typeof(PointF)), "PointF");
102
Assert.False(
_imgConv
.CanConvertTo(null, typeof(Size)), "Size");
103
Assert.False(
_imgConv
.CanConvertTo(null, typeof(SizeF)), "SizeF");
104
Assert.False(
_imgConv
.CanConvertTo(null, typeof(object)), "object");
105
Assert.False(
_imgConv
.CanConvertTo(null, typeof(int)), "int");
125
Image newImage = (Image)
_imgConv
.ConvertFrom(null, CultureInfo.InvariantCulture, _imageBytes);
139
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertFrom("System.Drawing.String"));
140
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
141
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new Bitmap(20, 20)));
142
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new Point(10, 10)));
143
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
144
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
157
Assert.Equal(_imageStr, (string)
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(string)));
158
Assert.Equal(_imageStr, (string)
_imgConv
.ConvertTo(_image, typeof(string)));
164
Assert.Equal("(none)", (string)
_imgConv
.ConvertTo(null, typeof(string)));
165
Assert.Equal("(none)", (string)
_imgConv
.ConvertTo(null, CultureInfo.CreateSpecificCulture("ru-RU"), null, typeof(string)));
175
byte[] newImageBytes = (byte[])
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, _imageBytes.GetType());
197
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Rectangle)));
198
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, _image.GetType()));
199
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Size)));
200
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Bitmap)));
201
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Point)));
202
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Metafile)));
203
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(object)));
204
Assert.Throws<NotSupportedException>(() =>
_imgConv
.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(int)));
219
Assert.True(
_imgConv
.GetPropertiesSupported(), "GetPropertiesSupported()");
220
Assert.True(
_imgConv
.GetPropertiesSupported(null), "GetPropertiesSupported(null)");
232
propsColl =
_imgConv
.GetProperties(null, _image, null);
236
propsColl =
_imgConv
.GetProperties(null, _image);
238
propsColl =
_imgConv
.GetProperties(_image);