I have a class called PageProcessor
with a method
private static async Task InsertPosts(IEnumerable<LrcPost> posts)
{
// ...
}
and I'm trying to call it in one of my unit tests like
PageProcessor processor = new PageProcessor();
MethodInfo dynMethod = processor.GetType()
.GetMethod
(
"InsertPosts",
BindingFlags.NonPublic | BindingFlags.Instance
);
dynMethod.Invoke(processor, new object[] { posts });
but am getting an NRE. Any idea why?
Aucun commentaire:
Enregistrer un commentaire