public static void ResolveIndexerParametersTest(string[] parameters, Type indexerOwner, bool expectedSuccess, object[] expectedIndexerParameters, PropertyInfo expectedIndexer) { if (!expectedSuccess) { Assert.Throws <Exception>( () => { ConfigurationHelpers.ResolveIndexerParameters(parameters, indexerOwner.GetTypeInfo()); }); } else { (object[] indexParameters, PropertyInfo indexer) = ConfigurationHelpers.ResolveIndexerParameters(parameters, indexerOwner.GetTypeInfo()); Assert.Equal(expectedIndexerParameters, indexParameters); Assert.Equal(expectedIndexer.ToString(), indexer.ToString()); //Direct equality checks are not supported } }