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