1 write to _imgFmtConv
System.Drawing.Common.Tests (1)
System\Drawing\ImageFormatConverterTests.cs (1)
22
_imgFmtConv
= new ImageFormatConverter();
32 references to _imgFmtConv
System.Drawing.Common.Tests (32)
System\Drawing\ImageFormatConverterTests.cs (32)
29
Assert.True(
_imgFmtConv
.CanConvertFrom(typeof(string)), "string (no context)");
30
Assert.True(
_imgFmtConv
.CanConvertFrom(null, typeof(string)), "string");
31
Assert.False(
_imgFmtConv
.CanConvertFrom(null, typeof(ImageFormat)), "ImageFormat");
32
Assert.False(
_imgFmtConv
.CanConvertFrom(null, typeof(Guid)), "Guid");
33
Assert.False(
_imgFmtConv
.CanConvertFrom(null, typeof(object)), "object");
34
Assert.False(
_imgFmtConv
.CanConvertFrom(null, typeof(int)), "int");
47
Assert.True(
_imgFmtConv
.CanConvertTo(typeof(string)), "string (no context)");
48
Assert.True(
_imgFmtConv
.CanConvertTo(null, typeof(string)), "string");
49
Assert.False(
_imgFmtConv
.CanConvertTo(null, typeof(ImageFormat)), "ImageFormat");
50
Assert.False(
_imgFmtConv
.CanConvertTo(null, typeof(Guid)), "Guid");
51
Assert.False(
_imgFmtConv
.CanConvertTo(null, typeof(object)), "object");
52
Assert.False(
_imgFmtConv
.CanConvertTo(null, typeof(int)), "int");
65
Assert.Equal(_imageFmt, (ImageFormat)
_imgFmtConv
.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp.ToString()));
72
Assert.Throws<NotSupportedException>(() =>
_imgFmtConv
.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp));
73
Assert.Throws<NotSupportedException>(() =>
_imgFmtConv
.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp.Guid));
74
Assert.Throws<NotSupportedException>(() =>
_imgFmtConv
.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
75
Assert.Throws<NotSupportedException>(() =>
_imgFmtConv
.ConvertFrom(null, CultureInfo.InvariantCulture, 10));
118
Assert.Throws<FormatException>(() =>
_imgFmtConv
.ConvertFrom("System.Drawing.String"));
119
Assert.Throws<FormatException>(() =>
_imgFmtConv
.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
120
Assert.Throws<FormatException>(() =>
_imgFmtConv
.ConvertFrom("[ImageFormat: abcdefgh-ijkl-mnop-qrst-uvwxyz012345]"));
130
Assert.Equal(_imageFmtStr, (string)
_imgFmtConv
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(string)));
131
Assert.Equal(_imageFmtStr, (string)
_imgFmtConv
.ConvertTo(_imageFmt, typeof(string)));
136
Assert.Equal(string.Empty, (string)
_imgFmtConv
.ConvertTo(null, typeof(string)));
137
Assert.Equal(string.Empty, (string)
_imgFmtConv
.ConvertTo(null, CultureInfo.CreateSpecificCulture("ru-RU"), null, typeof(string)));
146
Assert.Throws<NotSupportedException>(() =>
_imgFmtConv
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(ImageFormat)));
147
Assert.Throws<NotSupportedException>(() =>
_imgFmtConv
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(Guid)));
148
Assert.Throws<NotSupportedException>(() =>
_imgFmtConv
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(object)));
149
Assert.Throws<NotSupportedException>(() =>
_imgFmtConv
.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(int)));
160
Assert.True(
_imgFmtConv
.GetStandardValuesSupported(), "GetStandardValuesSupported()");
161
Assert.True(
_imgFmtConv
.GetStandardValuesSupported(null), "GetStandardValuesSupported(null)");
247
CheckStandardValues(
_imgFmtConv
.GetStandardValues());
248
CheckStandardValues(
_imgFmtConv
.GetStandardValues(null));