System.Reflection.Tests.PropertyInfoTests.GetValue_Invalid_TestData C# (CSharp) Method

GetValue_Invalid_TestData() public static method

public static GetValue_Invalid_TestData ( ) : IEnumerable
return IEnumerable
        public static IEnumerable<object[]> GetValue_Invalid_TestData()
        {
            // Incorrect indexer parameters
            yield return new object[] { typeof(CustomIndexerNameClass), "BasicIndexer", new CustomIndexerNameClass(), new object[] { 1, "2", 3 }, typeof(TargetParameterCountException) };
            yield return new object[] { typeof(CustomIndexerNameClass), "BasicIndexer", new CustomIndexerNameClass(), null, typeof(TargetParameterCountException) };

            // Incorrect type
            yield return new object[] { typeof(CustomIndexerNameClass), "BasicIndexer", new CustomIndexerNameClass(), new object[] { "1", "2" }, typeof(ArgumentException) };

            // Readonly
            yield return new object[] { typeof(BaseClass), nameof(BaseClass.WriteOnlyProperty), new BaseClass(), null, typeof(ArgumentException) };

            // Null target
            yield return new object[] { typeof(CustomIndexerNameClass), "BasicIndexer", null, new object[] { "1", "2" }, typeof(TargetException) };
        }