60 instantiations of CustomTypeDescriptorContext
WindowsBase.Tests (60)
System\Windows\Input\KeyConverterTests.cs (60)
19
yield return new object?[] { new
CustomTypeDescriptorContext
(), null, false };
20
yield return new object?[] { new
CustomTypeDescriptorContext
(), typeof(object), false };
21
yield return new object?[] { new
CustomTypeDescriptorContext
(), typeof(string), false };
22
yield return new object?[] { new
CustomTypeDescriptorContext
(), typeof(InstanceDescriptor), false };
23
yield return new object?[] { new
CustomTypeDescriptorContext
(), typeof(Key), false };
24
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = new object() }, null, false };
25
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = new object() }, typeof(object), false };
28
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = new object() }, typeof(InstanceDescriptor), false };
29
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = new object() }, typeof(Key), false };
30
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None }, null, false };
31
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None }, typeof(object), false };
32
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None }, typeof(string), true };
33
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None }, typeof(InstanceDescriptor), false };
34
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None }, typeof(Key), false };
35
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.Cancel }, null, false };
36
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.Cancel }, typeof(object), false };
37
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.Cancel }, typeof(string), true };
38
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.Cancel }, typeof(InstanceDescriptor), false };
39
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.Cancel }, typeof(Key), false };
40
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.A }, null, false };
41
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.A }, typeof(object), false };
42
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.A }, typeof(string), true };
43
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.A }, typeof(InstanceDescriptor), false };
44
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.A }, typeof(Key), false };
45
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.OemClear }, null, false };
46
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.OemClear }, typeof(object), false };
47
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.OemClear }, typeof(string), true };
48
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.OemClear }, typeof(InstanceDescriptor), false };
49
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.OemClear }, typeof(Key), false };
50
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed }, null, false };
51
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed }, typeof(object), false };
52
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed }, typeof(string), true };
53
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed }, typeof(InstanceDescriptor), false };
54
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed }, typeof(Key), false };
55
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None - 1 }, null, false };
56
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None - 1 }, typeof(object), false };
57
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None - 1 }, typeof(string), false };
58
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None - 1 }, typeof(InstanceDescriptor), false };
59
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.None - 1 }, typeof(Key), false };
60
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed + 1 }, null, false };
61
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed + 1 }, typeof(object), false };
62
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed + 1 }, typeof(string), false };
63
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed + 1 }, typeof(InstanceDescriptor), false };
64
yield return new object?[] { new
CustomTypeDescriptorContext
{ Instance = Key.DeadCharProcessed + 1 }, typeof(Key), false };
80
var context = new
CustomTypeDescriptorContext
{ Instance = new object() };
142
Assert.Equal(expected, converter.ConvertTo(new
CustomTypeDescriptorContext
(), null, value, typeof(string)));
143
Assert.Equal(expected, converter.ConvertTo(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, value, typeof(string)));
155
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new
CustomTypeDescriptorContext
(), null, value, typeof(string)));
156
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, value, typeof(string)));
168
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new
CustomTypeDescriptorContext
(), null, value, typeof(string)));
169
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, value, typeof(string)));
180
Assert.Throws<InvalidCastException>(() => converter.ConvertTo(new
CustomTypeDescriptorContext
(), null, value, typeof(string)));
181
Assert.Throws<InvalidCastException>(() => converter.ConvertTo(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, value, typeof(string)));
206
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, value, destinationType));
225
Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, Key.None, null!));
239
Assert.Equal(expected, converter.CanConvertFrom(new
CustomTypeDescriptorContext
(), sourceType));
371
Assert.Equal(expected, converter.ConvertFrom(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, value));
380
Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, null));
403
Assert.Throws<ArgumentException>(() => converter.ConvertFrom(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, value));
420
Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new
CustomTypeDescriptorContext
(), CultureInfo.InvariantCulture, value));
1 reference to CustomTypeDescriptorContext
WindowsBase.Tests (1)
System\Windows\Input\KeyConverterTests.cs (1)
80
var
context = new CustomTypeDescriptorContext { Instance = new object() };