-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Labels
Description
Description
Recently in trying to unit test middleware that utlized invocation results, I was not able to directly since interfaces used by that pipeline, such as IFunctionBindingsFeature, are internal. As a result I ended up having to go with an abstraction that is mockable for my unit tests that e.g.
/// <summary>
/// Internal abstraction for accessing function invocation results.
/// This exists as a workaround for IFunctionBindingsFeature being internal in the Worker SDK.
/// </summary>
internal interface IFunctionResultAccessor
{
/// <summary>
/// Gets the current invocation result value.
/// </summary>
object? GetResult(FunctionContext context);
/// <summary>
/// Sets the invocation result value.
/// </summary>
void SetResult(FunctionContext context, object? value);
}