I'm writing unit tests for a WinRT app, and I am able to invoke non-async private methods using this:
TheObjectClass theObject = new TheObjectClass();
Type objType = typeof(TheObjectClass);
objType.GetTypeInfo()
.GetDeclaredMethod("ThePrivateMethod")
.Invoke(theObject, null);
However, if the private method in question is async
, the code will continue execution without waiting for it to finish.
How do I add await
functionality to this?